

CREATE TABLE ACC_LEDTERMSCONDITIONS
(
	LEDTRMID INT IDENTITY(1,1) NOT NULL,
	LID INT NOT NULL,
	TRMID INT NOT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (LEDTRMID ASC),
	UNIQUE NONCLUSTERED(LID ASC,TRMID ASC)
)
GO
CREATE TABLE ACC_PRERECONCILE
(
	PRERECONCILEID INT IDENTITY(1,1) NOT NULL,
	FINYEAR VARCHAR(20)  NOT NULL,
	LID INT NOT NULL,
	PARTICULARS VARCHAR(52)  NOT NULL,
	TRANSACTIONTYPEID SMALLINT NOT NULL,
	TRANSACTIONDATE SMALLDATETIME NOT NULL,
	CHEQUENO VARCHAR(52)  NULL,
	AMOUNT NUMERIC(17, 3) NULL,
	ISRECONCILED BIT NOT NULL,
	RECDATE SMALLDATETIME NULL,
	REMARKS VARCHAR(52)  NULL,
	NARRATION VARCHAR(150)  NULL,
	ISDIRECT BIT NOT NULL,
	PRIMARY KEY (PRERECONCILEID ASC) 
)
GO
CREATE TABLE GROUP_PERMISSION
(
	ID BIGINT IDENTITY(1,1) NOT NULL,
	GROUP_ID BIGINT NULL,
	PAGE_ID BIGINT NULL,
	PAGE_VIEW BIT NULL,
	PAGE_ADD BIT NULL,
	PAGE_EDIT BIT NULL,
	PAGE_DELETE BIT NULL,
	CNAME NVARCHAR(50)  NULL,
	CDATE DATETIME NULL,
	ENAME NVARCHAR(50)  NULL,
	EDATE DATETIME NULL,
	PRIMARY KEY (ID ASC)
)
GO
CREATE TABLE IVC_PURCHASEORDERFORMAT
(
	FORMATID INT IDENTITY(1,1) NOT NULL,
	FORMATNAME VARCHAR(50)  NOT NULL,
	SETDEFAULT BIT NOT NULL,
	DESCRIPTION BIT NOT NULL,
	UOM BIT NOT NULL,
	PREPAREDBY BIT NOT NULL,
	CHECKEDBY BIT NOT NULL,
	NARRATION BIT NOT NULL,
	REMARKS BIT NOT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (FORMATID ASC)
)
GO

CREATE TABLE MAS_COUNTRY
(
	COUNTRYID TINYINT IDENTITY(1,1) NOT NULL,
	COUNTRYNAME VARCHAR(50)  NULL,
	PRIMARY KEY (COUNTRYID ASC)
)
GO
CREATE TABLE ACC_COSTCENTRECLASS
(
	CLASSID INT IDENTITY(1,1) NOT NULL,
	CLASSNAME VARCHAR(52)  NULL,
	PRIMARY KEY (CLASSID ASC)
)
GO
CREATE TABLE USER_PERMISSION
(
	ID BIGINT IDENTITY(1,1) NOT NULL,
	USER_ID BIGINT NULL,
	PAGE_ID BIGINT NULL,
	PAGE_ADD BIT NULL,
	PAGE_EDIT BIT NULL,
	PAGE_VIEW BIT NULL,
	PAGE_DELETE BIT NULL,
	CNAME NVARCHAR(50)  NULL,
	CDATE DATETIME NULL,
	ENAME NVARCHAR(50)  NULL,
	EDATE DATETIME NULL,
	PRIMARY KEY (ID ASC)
)
GO


CREATE TABLE IVC_PURCHASEORDERFORMAT_NUMBERS
(
	PONUMID INT IDENTITY(1,1) NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	FORMATID INT NOT NULL,
	NUMBERINGMETHOD BIT NOT NULL,
	PREFIX VARCHAR(15)  NULL,
	STARTNUMBER INT NULL,
	SUFFIX VARCHAR(15)  NULL,
	NUMWIDTH SMALLINT NULL,
	PREFILLZERO BIT NOT NULL,
	RESETYEAR BIT NOT NULL,
	PRIMARY KEY (PONUMID ASC)
)
GO

CREATE TABLE ACC_TERMSCONDITIONS
(
	TRMID INT IDENTITY(1,1) NOT NULL,
	TRMDESC VARCHAR(100)  NOT NULL,
	APPLICTOTRAN SMALLINT NOT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME SMALLDATETIME NULL,
	EDATE VARCHAR(50)  NULL,
	PRIMARY KEY (TRMID ASC),
	UNIQUE (TRMDESC ASC) 
)
GO
CREATE TABLE IVR_DCGROUP
(
	ID INT IDENTITY(1,1) NOT NULL,
	SHORTNAME VARCHAR(10)  NULL,
	SUBCLASS VARCHAR(50)  NULL,
	DEFUALTGROUP BIT NOT NULL,
  PRIMARY KEY(ID ASC)
)
GO

CREATE TABLE ACC_POMAIN
(
	POID INT IDENTITY(1,1) NOT NULL,
	BILLFORMATID INT NOT NULL,
	LID INT NOT NULL,
	PODATE SMALLDATETIME NOT NULL,
	POPREFIX VARCHAR(50)  NULL,
	POVOUCHERNO VARCHAR(50)  NULL,
	POSUFFIX VARCHAR(50)  NULL,
	TAXGROUPID INT NULL,
	DELIVERYLOCATION INT NULL,
	CASH_CREDIT BIT NULL,
	CREDITDAY INT NULL,
	PRIORITY VARCHAR(50)  NULL,
	TOTALQTY DECIMAL(18, 3) NULL,
	PRETAXTOTAL DECIMAL(18, 3) NULL,
	TAXABLEAMT DECIMAL(18, 3) NULL,
	TAXAMT DECIMAL(18, 3) NULL,
	POSTTAXTOTAL DECIMAL(18, 3) NULL,
	ROUNDOFF DECIMAL(18, 3) NULL,
	GRANDTOTAL DECIMAL(18, 3) NULL,
	BILLINGADDRESS VARCHAR(350)  NULL,
	DELIVERYADDRESS VARCHAR(350)  NULL,
	DELIVERYTERMS VARCHAR(350)  NULL,
	DELIVERYMODE VARCHAR(50)  NULL,
	DELIVERYDATE SMALLDATETIME NULL,
	DOCUMENTNO VARCHAR(50)  NULL,
	TRANSPORTERNAME VARCHAR(100)  NULL,
	PREPAREBY VARCHAR(50)  NULL,
	CHECKBY VARCHAR(50)  NULL,
	AUTHORIZEDSIGNATORY VARCHAR(50)  NULL,
	NARRATION VARCHAR(250)  NULL,
	REMARKS VARCHAR(250)  NULL,
	STATUS INT NULL,
	APPROVALDATE SMALLDATETIME NULL,
	APPROVALBY VARCHAR(50)  NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
  PRIMARY KEY (POID ASC)
)
GO

CREATE TABLE IVR_DCCATEGORY
(
	ID INT IDENTITY(1,1) NOT NULL,
	CATEGORYNAME VARCHAR(100)  NULL,
	CATEGORYCODE VARCHAR(10)  NULL,
 CONSTRAINT PK_IVR_DCDCCATEGORY PRIMARY KEY (ID ASC)
)
GO

CREATE TABLE LOGIN
(
	USERID INT IDENTITY(1,1) NOT NULL,
	USERNAME VARCHAR(50)  NULL,
	PASSWORD VARCHAR(25)  NULL,
	FIRSTNAME VARCHAR(35)  NULL,
	LASTNAME VARCHAR(35)  NULL,
	GROUPID INT NULL,
	ISGROUPACTIVE BIT NULL,
	LASTLOGIN SMALLDATETIME NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (USERID ASC)
)
GO

CREATE TABLE IVC_PURCHASEORDERFORMAT_TAX_DISCOUNT_DETAILS
(
	FORMATID INT NOT NULL,
	TAXLEVEL BIT NOT NULL,
	DISCOUNTLEVEL TINYINT NOT NULL,
	TAXTYPEID INT NULL,
	TAXCALON TINYINT NULL,
	ITEMTAXTYPE TINYINT NULL
)
GO
CREATE TABLE IVC_OPTIONSETTINGS
(
	ACCOUNTINGMETHOD BIT NOT NULL,
	DECIMALPLACES TINYINT NULL,
	GENERATEST3 BIT NOT NULL,
	WRITEOFF_LEDGERID INT NULL,
	TDS_LEDGERID INT NULL
)
GO
CREATE TABLE IVC_ROUNDOFFSETTINGS
(
	ROUNDOFFID INT IDENTITY(1,1) NOT NULL,
	ROUNDOFFDESC VARCHAR(50)  NULL,
	ROUNDOFFOPTION TINYINT NULL,
	PRIMARY KEY (ROUNDOFFID ASC)
)
GO
CREATE TABLE SVT_SERVICEMASTER
(
	SERVICEID INT NOT NULL,
	SERVICENAME VARCHAR(255)  NULL,
	SUBCLAUSE VARCHAR(10)  NULL,
	ACHEADST VARCHAR(10)  NULL,
	ACHEADOTHERS VARCHAR(10)  NULL,
	PREDEFINED TINYINT NULL,
	PRIMARY KEY (SERVICEID ASC)
)
GO

CREATE TABLE IVC_SERVICECATEGORY
(
	SERVICECATEGORYID INT IDENTITY(1,1) NOT NULL,
	SERVICECATEGORY VARCHAR(50)  NOT NULL,
	DEFAULTCATEGORY BIT NULL,
	PRIMARY KEY (SERVICECATEGORYID ASC),
	UNIQUE (SERVICECATEGORY ASC)
)
GO

CREATE TABLE COM_CLIENTDET
(
	ASSTRANID INT NOT NULL,
	CLIENTID INT NOT NULL,
	ASSYEAR INT NOT NULL,
	DDOF SMALLDATETIME NULL,
	ADOF SMALLDATETIME NULL,
	AOCODE VARCHAR(15)  NULL,
	WARDRANGE VARCHAR(255)  NULL,
	REFNUM VARCHAR(110)  NULL,
	REPNAME VARCHAR(75)  NULL,
	REPADDRESS VARCHAR(255)  NULL,
	REPPAN VARCHAR(20)  NULL,
	REPFATHER VARCHAR(40)  NULL,
	REPDESIG VARCHAR(40)  NULL,
	SIGDATE SMALLDATETIME NULL,
	SIGPLACE VARCHAR(40)  NULL,
	INCTAXYN TINYINT NULL,
	ITRNUM TINYINT NULL,
	REFNOTI VARCHAR(25)  NULL,
	TRADNAME VARCHAR(75)  NULL
)
GO
CREATE TABLE IVC_YEARLYSETTINGS
(
	FINYEAR SMALLINT NOT NULL,
	THRESHOLDLIMIT NUMERIC(17, 3) NULL,
	POSTBILL_LIMIT NUMERIC(17, 3) NULL,
	PRIMARY KEY (FINYEAR ASC)
)
GO

CREATE TABLE IVR_STOCKDET
(
	STKDETID INT IDENTITY(1,1) NOT NULL,
	TYPEOFENTRY TINYINT NOT NULL,
	ENTRYID INT NOT NULL,
	ITMROWID INT NOT NULL,
	ITMID INT NOT NULL,
	WHSID INT NOT NULL,
	BATID INT NULL,
	QTY_PRIMUNIT NUMERIC(11, 4) NULL,
	QTY_ALTUNIT NUMERIC(11, 4) NULL,
	RATE_PRIMUNIT NUMERIC(17, 3) NULL,
	RATE_ALTUNIT NUMERIC(17, 3) NULL,
	BALANCEQTY NUMERIC(17, 3) NULL,
	WEIGHTEDAVGPRICE NUMERIC(17, 3) NULL,
	ENTRYDATE DATETIME NULL,
	PRIMARY KEY (STKDETID ASC)
)
GO

CREATE TABLE IVC_PURCHASEORDER_TOTAL
(
	POID INT NOT NULL,
	TAXABLEAMT NUMERIC(17, 3) NULL,
	NONTAXABLEAMT NUMERIC(17, 3) NULL,
	TOTALAMTBEFTAX NUMERIC(17, 3) NULL,
	SERVICETAXRATE NUMERIC(6, 3) NULL,
	SERVICETAXAMT NUMERIC(17, 3) NULL,
	EDUCESS1RATE NUMERIC(6, 3) NULL,
	EDUCESS1AMT NUMERIC(17, 3) NULL,
	EDUCESS2RATE NUMERIC(6, 3) NULL,
	EDUCESS2AMT NUMERIC(17, 3) NULL,
	LUXURYTAXRATE NUMERIC(6, 3) NULL,
	LUXURYTAXAMT NUMERIC(17, 3) NULL,
	ROUNDOFFAMT NUMERIC(17, 3) NULL,
	TAXDISCOUNT NUMERIC(17, 3) NULL,
	NONTAXDISCOUNT NUMERIC(17, 3) NULL,
	TAXDISRATE NUMERIC(6, 3) NULL,
	NONTAXDISRATE NUMERIC(6, 3) NULL,
	VATAMT NUMERIC(17, 3) NULL,
	TOTALAMT NUMERIC(17, 3) NULL
)
GO
CREATE TABLE ACC_SALESPRICEGROUP
(
	SPGID INT IDENTITY(1,1) NOT NULL,
	SPGNAME VARCHAR(50)  NOT NULL,
	DISCOUNTPER NUMERIC(6, 3) NULL,
	CNAME NVARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NVARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (SPGID ASC),
	UNIQUE (SPGNAME ASC) 
)
GO
CREATE TABLE IVC_PURCHASEORDER_CHILD
(
	POCHILDID INT IDENTITY(1,1) NOT NULL,
	POID INT NOT NULL,
	SERVICEID INT NOT NULL,
	ADDDESC VARCHAR(250)  NULL,
	UNIT NUMERIC(10, 3) NULL,
	RATE NUMERIC(17, 3) NULL,
	GROSSAMT NUMERIC(17, 3) NULL,
	UOM VARCHAR(50)  NULL,
	SERVICETAXAMT NUMERIC(17, 3) NULL,
	CESS1AMT NUMERIC(17, 3) NULL,
	CESS2AMT NUMERIC(17, 3) NULL,
	LTAMT NUMERIC(17, 3) NULL,
	DISCOUNT NUMERIC(17, 3) NULL,
	DISCOUNTRATE NUMERIC(6, 3) NULL,
	TAXABLEAMTAFTERDIS NUMERIC(17, 3) NULL,
	SERVICECHARGERATE NUMERIC(6, 3) NULL,
	SERVICECHARGEAMT NUMERIC(17, 3) NULL,
	VATAMT NUMERIC(17, 3) NULL,
	TOTALAMT NUMERIC(17, 3) NULL
)
GO
CREATE TABLE IVR_STKJRNL
(
	SJRID INT IDENTITY(1,1) NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	TFOID INT NOT NULL,
	SJRNUM VARCHAR(10)  NOT NULL,
	SJRDATE DATETIME NOT NULL,
	FROM_WHSID INT NULL,
	TO_WHSID INT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE DATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE DATETIME NULL,
  PRIMARY KEY (SJRID ASC)
)
GO

CREATE TABLE ACC_SALESPERSON
(
	SPRID INT IDENTITY(1,1) NOT NULL,
	SPRNAME VARCHAR(60)  NOT NULL,
	PRIMARY KEY (SPRID ASC),
	UNIQUE(SPRNAME ASC)
)
GO

CREATE TABLE ACC_TRANSETTINGS
(
	TYPEID INT IDENTITY(0,1) NOT NULL,
	PARENTTYPEID INT NOT NULL,
	TRANSACTIONNAME VARCHAR(52)  NOT NULL,
	ISAUTONO BIT NOT NULL,
	RESETNO BIT NOT NULL,
	ISREFERENCE BIT NOT NULL,
	ABBREVIATION VARCHAR(52)  NULL,
	ISDEFAULTNARRATION BIT NOT NULL,
	EFFECTIVEDATE SMALLDATETIME NULL,
	BILLFORMATID SMALLINT NULL,
	MODULETYPE TINYINT NOT NULL,
	CCALLOCATIONTYPE TINYINT NOT NULL,
	PRIMARY KEY (TYPEID ASC)
)
GO
CREATE TABLE IVR_STKJRNL_CUSTOMFIELDS
(
	CFID INT IDENTITY(1,1) NOT NULL,
	TFOID INT NOT NULL,
	SJRID INT NOT NULL,
	ITMID INT NULL,
	FIELD1 VARCHAR(100)  NULL,
	FIELD2 VARCHAR(100)  NULL,
	FIELD3 VARCHAR(100)  NULL,
	FIELD4 VARCHAR(100)  NULL,
	FIELD5 VARCHAR(100)  NULL,
	FIELD6 VARCHAR(100)  NULL,
	FIELD7 VARCHAR(100)  NULL,
	FIELD8 VARCHAR(100)  NULL,
	FIELD9 VARCHAR(100)  NULL,
	FIELD10 VARCHAR(100)  NULL
)
GO
CREATE TABLE ACC_TAXSUBCLASS
(
	SUBCLASSID SMALLINT IDENTITY(1,1) NOT NULL,
	SUBCLASSNAME VARCHAR(50)  NOT NULL,
	PRIMARY KEY (SUBCLASSID ASC)
)
GO
CREATE TABLE IVC_PURCHASEORDER_MAIN
(
	POID BIGINT IDENTITY(1,1) NOT NULL,
	FORMATID INT NULL,
	PONUMBER BIGINT NULL,
	LID BIGINT NULL,
	PODATE SMALLDATETIME NULL,
	FINYEAR INT NULL,
	PROIRITY VARCHAR(50)  NULL,
	CASHCREDIT BIT NULL,
	CREDITDAYS INT NULL,
	PREPAREDBY VARCHAR(150)  NULL,
	CHECHEDBY VARCHAR(150)  NULL,
	NARRATION VARCHAR(250)  NULL,
	REMARKS VARCHAR(150)  NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (POID ASC)
)
GO
CREATE TABLE IVR_STKJRNL_ITEMDET
(
	SIDID INT IDENTITY(1,1) NOT NULL,
	SJIID INT NOT NULL,
	WHSID INT NOT NULL,
	BATID INT NULL,
	DETQTY NUMERIC(11, 4) NOT NULL,
	DETALTQTY NUMERIC(11, 4) NULL,
	WARRANTY SMALLINT NULL,
	WARRANTYPERIOD TINYINT NULL,
	PRIMARY KEY (SIDID ASC)
)
GO
CREATE TABLE ACC_TAXTYPE
(
	TAXTYPEID TINYINT NOT NULL,
	TAXTYPE VARCHAR(30)  NOT NULL,
	TAXCATEGORY TINYINT NOT NULL,
	PRIMARY KEY (TAXTYPEID ASC), 
	UNIQUE(TAXTYPE ASC)
)
GO
CREATE TABLE IVR_STKJRNL_ITEMDETTIM
(
	SIDID INT NOT NULL,
	LOGNUM VARCHAR(15)  NULL,
	TIMLENGTH NUMERIC(11, 4) NULL,
	GIRTH NUMERIC(11, 4) NULL,
	WIDTH NUMERIC(11, 4) NULL,
	THICKNESS NUMERIC(11, 4) NULL,
	NOOFPCS NUMERIC(11, 4) NOT NULL,
	EDITQTY BIT NOT NULL,
	PRIMARY KEY (SIDID ASC) 
)
GO
CREATE TABLE ACC_MONTHYEAR
(
	MONTHID INT IDENTITY(1,1) NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	YEARVALUE SMALLINT NOT NULL,
	MONTHVALUE TINYINT NOT NULL,
	PRIMARY KEY (MONTHID ASC)
)
GO
CREATE TABLE MAS_FINYEAR
(
	FINYEAR SMALLINT NOT NULL,
	PRIMARY KEY (FINYEAR ASC)
)
GO
CREATE TABLE IVR_STKJRNL_ITEMTIM
(
	SJIID INT NOT NULL,
	LENGTH_UOMID INT NULL,
	GIRTH_UOMID INT NULL,
	WIDTH_UOMID INT NULL,
	THICKNESS_UOMID INT NULL,
	PRIMARY KEY (SJIID ASC)
)
GO
CREATE TABLE IVR_STKJRNL_OTHERS
(
	SJRID INT NOT NULL,
	PREPAREDBY VARCHAR(100)  NULL,
	CHECKEDBY VARCHAR(100)  NULL,
	AUTHRSDSIGNAT VARCHAR(100)  NULL,
	NARRATION VARCHAR(150)  NULL,
	REMARKS VARCHAR(150)  NULL,
	NOTE VARCHAR(150)  NULL,
	PRIMARY KEY(SJRID ASC)
)
GO
CREATE TABLE IVR_TRANSETTINGS
(
	DCIN BIT NULL,
	PURCRETURN BIT NULL,
	DCOUT BIT NULL,
	SALERETURN BIT NULL,
	STOCKJRNL BIT NULL,
	SEPEFFECTIVEDATE BIT NULL,
	ALLOWZEROAMOUNT BIT NULL,
	PURCLEDGERALLOCOPT TINYINT NULL,
	SALELEDGERALLOCOPT TINYINT NULL,
	GLALLOCMETHOD TINYINT NULL
)
GO

CREATE TABLE ACC_LEDADDRESS
(
	LID INT NOT NULL,
	ADDRESSID INT IDENTITY(1,1) NOT NULL,
	TITLE VARCHAR(6)  NULL,
	LNAME VARCHAR(52)  NULL,
	ADDRESS1 VARCHAR(52)  NULL,
	ADDRESS2 VARCHAR(52)  NULL,
	ADDRESS3 VARCHAR(52)  NULL,
	PLACE VARCHAR(52)  NULL,
	PINCODE INT NULL,
	STATEID TINYINT NULL,
	COUNTRY VARCHAR(52)  NULL,
	WEBSITE VARCHAR(52)  NULL,
	EMAIL VARCHAR(52)  NULL,
	PHONE VARCHAR(52)  NULL,
	FAX VARCHAR(52)  NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	EDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL
)
GO
CREATE TABLE ACC_COMPANY
(
	COMPID INT IDENTITY(1,1) NOT NULL,
	COMPNAME VARCHAR(75)  NOT NULL,
	TRADINGNAME VARCHAR(75)  NOT NULL,
	BTYPE TINYINT NULL,
	OTHBTYPE VARCHAR(100)  NULL,
	STATUSID TINYINT NULL,
	OTHSTATUS VARCHAR(100)  NULL,
	ISACCENABLED BIT NULL,
	ISINVCENABLED BIT NULL,
	ISINVRENABLED BIT NULL,
	BOOKSFROMDATE SMALLDATETIME NULL,
	BOOKSENDDATE SMALLDATETIME NULL,
	WORKINGDATE SMALLDATETIME NULL,
	ADD1 VARCHAR(100)  NULL,
	ADD2 VARCHAR(100)  NULL,
	ADD3 VARCHAR(100)  NULL,
	ADD4 VARCHAR(100)  NULL,
	PLACE VARCHAR(50)  NULL,
	PINCODE INT NULL,
	STATEID TINYINT NULL,
	COUNTRY VARCHAR(50)  NULL,
	PHONE VARCHAR(20)  NULL,
	FAX VARCHAR(20)  NULL,
	EMAIL VARCHAR(52)  NULL,
	WEBSITE VARCHAR(52)  NULL,
	ACTIVITY VARCHAR(52)  NULL,
	MISC1 VARCHAR(100)  NULL,
	MISC2 VARCHAR(100)  NULL,
	MISC3 VARCHAR(100)  NULL,
	MISC4 VARCHAR(100)  NULL,
	PAN VARCHAR(100)  NULL,
	PANDATE SMALLDATETIME NULL,
	TDSNO VARCHAR(50)  NULL,
	TDSDATE SMALLDATETIME NULL,
	ISVATENABLE BIT NULL,
	VATNO VARCHAR(12)  NULL,
	VATDATE SMALLDATETIME NULL,
	ISCSTENABLE BIT NULL,
	CSTNO VARCHAR(12)  NULL,
	CSTDATE SMALLDATETIME NULL,
	ISSTENABLED BIT NULL,
	SERTNO VARCHAR(15)  NULL,
	SERTNDATE SMALLDATETIME NULL,
	ISCEENABLED BIT NULL,
	CEPAN VARCHAR(15)  NULL,
	CEPANDATE SMALLDATETIME NULL,
	ISLTENABLED BIT NULL,
	LTNO VARCHAR(12)  NULL,
	LTNDATE SMALLDATETIME NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NCHAR(10)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (COMPID ASC)
)
GO
CREATE TABLE ACC_TRANSETTINGDETAILS
(
	SETTINGDETAILID INT IDENTITY(1,1) NOT NULL,
	TYPEID INT NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	STARTNO INT NULL,
	PREFIX VARCHAR(10)  NULL,
	SUFFIX VARCHAR(10)  NULL,
	ACCLEVELNARRATION BIT NOT NULL,
	NARRATION VARCHAR(MAX)  NULL,
	PRINTONSAVE BIT NOT NULL,
	PRIMARY KEY CLUSTERED (TYPEID ASC, FINYEAR ASC)
)
GO
CREATE TABLE IVR_TRANSTYPE
(
	ID INT IDENTITY(1,1) NOT NULL,
	TRANTYPE VARCHAR(50)  NULL,
	ACTIVE BIT NULL
)
GO
CREATE TABLE ACC_USERWORKINGDATE
(
	USERID INT NULL,
	WORKINGDATE SMALLDATETIME NULL
)
GO
CREATE TABLE IVC_TRANSACTIONFORMAT
(
	FORMATID INT IDENTITY(1,1) NOT NULL,
	FORMATNAME VARCHAR(50)  NOT NULL,
	SETASDEFAULT BIT NOT NULL,
	TRANSACTIONTYPE TINYINT NOT NULL,
	YEARREFERENCE BIT NOT NULL,
	UNITRATE BIT NOT NULL,
	ADDDESC BIT NOT NULL,
	POSTBILLING BIT NOT NULL,
	TAXINCLUSIVE BIT NOT NULL,
	NONTAXABLE BIT NOT NULL,
	UOM BIT NOT NULL,
	NARRATION BIT NOT NULL,
	REMARKS BIT NOT NULL,
	PREPAREDBY BIT NOT NULL,
	SERVICEDBY BIT NOT NULL,
	CHECKEDBY BIT NOT NULL,
	REFERENCENUMBER BIT NOT NULL,
	PRINTONSAVE BIT NOT NULL,
	SHOWSERVICECHARGE BIT NOT NULL,
	CUSTOMREPORTPATH VARCHAR(250)  NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (FORMATID ASC),
	UNIQUE (FORMATNAME ASC)
)
GO
CREATE TABLE IVR_SETTINGS
(
	WHSMULTI BIT NULL,
	WHSCAP VARCHAR(25)  NOT NULL,
	SPGOPTION TINYINT NULL,
	VMDOPTION TINYINT NULL,
	BATACTIVE BIT NULL,
	BATCAP VARCHAR(15)  NOT NULL,
	BATEXPIRYDATE BIT NULL,
	BATWARRANTY BIT NULL,
	BATACTUALVALUATN BIT NULL,
	OTHSALEPERSONCAP VARCHAR(25)  NOT NULL,
	OTHAUTOPORTBS BIT NULL,
	OTHBOM BIT NULL,
	OTHVATERETURN BIT NULL,
	AUTOJRNL BIT NULL,
	TCS BIT NULL,
	TIMBER BIT NULL
)
GO
CREATE TABLE IVR_STOCKDET_COGS
(
	STKDETCOGSID INT IDENTITY(1,1) NOT NULL,
	PARENT_STKDETID INT NOT NULL,
	COGS_STKDETID INT NOT NULL,
	COGSQTY NUMERIC(11, 4) NULL,
	COSRATE NUMERIC(17, 3) NULL,
	COGSAMT NUMERIC(17, 3) NULL,
	OUTWARDSTKDETID INT NULL,
  PRIMARY KEY (STKDETCOGSID ASC)
)
GO
CREATE TABLE ACC_LEDDELIVERYADDDETAILS
(
	DELIVERYADDID INT IDENTITY(1,1) NOT NULL,
	LID INT NOT NULL,
	TITLE VARCHAR(6)  NULL,
	CONTACTNAME VARCHAR(100)  NULL,
	ADD1 VARCHAR(52)  NULL,
	ADD2 VARCHAR(52)  NULL,
	ADD3 VARCHAR(52)  NULL,
	ADD4 VARCHAR(52)  NULL,
	PINCODE INT NULL,
	STATEID TINYINT NULL,
	COUNTRY VARCHAR(52)  NULL,
	LSTNUM VARCHAR(60)  NULL,
	LSTDATE SMALLDATETIME NULL,
	CSTNUM VARCHAR(60)  NULL,
	CSTDATE SMALLDATETIME NULL,
	CEPANUM VARCHAR(60)  NULL,
	CEPADATE SMALLDATETIME NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY(DELIVERYADDID ASC)
)
GO
CREATE TABLE IVR_STOCKTYPE
(
	STOCKTYPEID INT IDENTITY(1,1) NOT NULL,
	STOCKTYPENAME VARCHAR(50)  NOT NULL,
  PRIMARY KEY (STOCKTYPEID ASC)
)
GO
CREATE TABLE IVR_TRANFORMAT
(
	TFOID INT IDENTITY(1,1) NOT NULL,
	TRANTYPE TINYINT NOT NULL,
	FORMATNAME VARCHAR(50)  NOT NULL,
	DCWITHAMOUNT BIT NULL,
	ROUNDOFF_LID INT NULL,
	DISCOUNT_LID INT NULL,
	TAXATITEM BIT NULL,
	DISCATITEM TINYINT NULL,
	SETASDEFAULT BIT NULL,
	ITEMADDNDESC BIT NULL,
	AMOUNTINCLUTAX BIT NULL,
	TRANREF BIT NULL,
	TERMSCONDITIONS BIT NULL,
	PRETAXCHARGES BIT NULL,
	POSTTAXCHARGES BIT NULL,
	NARRATION BIT NULL,
	DEFAULTNARRATION BIT NULL,
	NOTE BIT NULL,
	REMARKS BIT NULL,
	PREPAREDBY BIT NULL,
	CHECKEDBY BIT NULL,
	AUTHSIGNATORY BIT NULL,
	POSTBILLING BIT NULL,
	PRINTONSAVE BIT NULL,
	VAT505ONSAVE BIT NULL,
	ITEMTYPE BIT NULL,
	DELIVERYDETAILS BIT NULL,
	STKJRNLOPT TINYINT NULL,
	INVDCHEADING VARCHAR(50)  NULL,
	DCTRACKPENDING BIT NULL,
	DOCNUMCAP VARCHAR(15)  NULL,
	TRANDECLARATION VARCHAR(250)  NULL,
	CENVAT BIT NULL,
	BILLLEVELTARIFF BIT NULL,
	CUSTOMREPORTPATH VARCHAR(250)  NULL,
	CNAME VARCHAR(150)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(150)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (TFOID ASC)
)
GO
CREATE TABLE ACC_LEDREGDETAILS
(
	LID INT NOT NULL,
	REGID INT IDENTITY(1,1) NOT NULL,
	PAN VARCHAR(10)  NULL,
	PANDATE SMALLDATETIME NULL,
	VATTIN VARCHAR(12)  NULL,
	VATTINDATE SMALLDATETIME NULL,
	CSTNO VARCHAR(12)  NULL,
	CSTDATE SMALLDATETIME NULL,
	TDSNO VARCHAR(10)  NULL,
	TDSDATE SMALLDATETIME NULL,
	SERTNO VARCHAR(15)  NULL,
	SERTNDATE SMALLDATETIME NULL,
	LTNO VARCHAR(12)  NULL,
	LTNDATE SMALLDATETIME NULL,
	CEPAN VARCHAR(15)  NULL,
	CEPANDATE SMALLDATETIME NULL,
	PANREF VARCHAR(10)  NULL,
	CREATED SMALLDATETIME NULL,
	MODIFIED SMALLDATETIME NULL,
	CREATEDBY SMALLINT NULL,
	MODIFIEDBY SMALLINT NULL,
	DEALERTYPE INT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE VARCHAR(50)  NULL,
	PRIMARY KEY (REGID ASC)
)
GO
CREATE TABLE IVR_TRANFORMATNUM
(
	TFNID INT IDENTITY(1,1) NOT NULL,
	TFOID INT NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	NUMBERINGMETHOD BIT NULL,
	NUMPREFIX VARCHAR(10)  NULL,
	NUMSTART INT NULL,
	NUMSUFFIX VARCHAR(10)  NULL,
	NUMDIGITS TINYINT NULL,
	NUMPREFILLZERO BIT NULL,
	RESETOPT TINYINT NULL,
 PRIMARY KEY (TFNID ASC)
)
GO

CREATE TABLE ACC_LEDOTHERDETAILS
(
	LID INT NOT NULL,
	ACTIVE BIT NOT NULL,
	TCS BIT NOT NULL,
	CREDITPERIOD SMALLINT NULL,
	CREDITLIMIT NUMERIC(17, 3) NULL,
	SPRID INT NULL,
	SPGID INT NULL,
	PURTAXMAINCLASSID SMALLINT NULL,
	SALETAXMAINCLASSID SMALLINT NULL,
	SUBTAXID INT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (LID ASC)
)
GO
CREATE TABLE IVR_ROUNDOFFSETTINGS
(
	ROFID INT IDENTITY(1,1) NOT NULL,
	ROFDESCRIPTION VARCHAR(50)  NOT NULL,
	ROFOPTION TINYINT NOT NULL,
	PRIMARY KEY (ROFID ASC)
)
GO
CREATE TABLE IVR_WARNINGSETTINGS
(
	WRNID INT IDENTITY(1,1) NOT NULL,
	WRNDESCRIPTION VARCHAR(50)  NOT NULL,
	WRNOPTION TINYINT NOT NULL,
 PRIMARY KEY (WRNID ASC)
)
GO
CREATE TABLE IVR_ITEMSETTINGS
(
	ITMCODE BIT NULL,
	ITMALTUNIT BIT NULL,
	ITMUPCCODE BIT NULL,
	ITMADDITIONALDESC BIT NULL,
	ITMALTDESC BIT NULL,
	ITMREMARKS BIT NULL,
	ITMBINREF BIT NULL
)
GO
CREATE TABLE ACC_PODETAILS
(
	ID INT IDENTITY(1,1) NOT NULL,
	POID INT NOT NULL,
	ITEMID INT NOT NULL,
	UOMID INT NULL,
	ITEMQTY DECIMAL(18, 3) NULL,
	RATEINCLTAX DECIMAL(18, 3) NULL,
	RATEEXCLTAX DECIMAL(18, 3) NULL,
	TAXABLEAMT DECIMAL(18, 3) NULL,
	TAXTYPE VARCHAR(50)  NULL,
	TAXTYPEID INT NULL,
	TAXGROUPID INT NULL,
	TAXRATE DECIMAL(18, 3) NULL,
	TAXAMT DECIMAL(18, 3) NULL,
	TOTALAMOUNT DECIMAL(18, 3) NULL,
	PRIMARY KEY (ID ASC)
)
GO
CREATE TABLE IVR_TRANFORMAT_REFCAP
(
	TFOID INT NOT NULL,
	REFID TINYINT NOT NULL,
	REFCAPTION VARCHAR(15)  NOT NULL
)
GO
CREATE TABLE IVR_ITEMALTUOM
(
	ITMID INT NOT NULL,
	UOMID INT NULL,
	CNAME NVARCHAR(20)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NVARCHAR(20)  NULL,
	EDATE SMALLDATETIME NULL
)
GO
CREATE TABLE IVR_ITEMOTH
(
	ITMID INT NOT NULL,
	UNITSIZE VARCHAR(20)  NULL,
	UNITWEIGHT NUMERIC(11, 4) NULL,
	UNITWEIGHT_UOMID INT NULL,
	STANDARDCOST NUMERIC(17, 3) NULL,
	ABCCATEGORY TINYINT NULL,
	IMAGEPATH VARCHAR(250)  NULL,
	ITMREMARKS VARCHAR(250)  NULL,
	ADDNLDESC VARCHAR(150)  NULL,
	BINREF VARCHAR(50)  NULL,
	PURCLEDGER_LID INT NULL,
	SALELEDGER_LID INT NULL,
	CNAME NVARCHAR(20)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NVARCHAR(20)  NULL,
	EDATE SMALLDATETIME NULL
)
GO

CREATE TABLE ACC_SETTINGS
(
	SETTINGID SMALLINT NOT NULL,
	SETTINGNAME VARCHAR(52)  NOT NULL,
	CHECKSTATUS BIT NOT NULL,
	SETTINGVALUE VARCHAR(52)  NULL,
 PRIMARY KEY (SETTINGID ASC)
)
GO
CREATE TABLE IVR_TRAN_DELIVERY
(
	TRNID INT NOT NULL,
	MODEOFDELIVERY VARCHAR(50)  NULL,
	DELIVERYDATE SMALLDATETIME NULL,
	DOCUMENTNUM VARCHAR(15)  NULL,
	VEHICLENUM VARCHAR(15)  NULL,
	FREIGHTINDICATOR VARCHAR(20)  NULL,
	TRANSPORTNAME VARCHAR(100)  NULL
)
GO
CREATE TABLE IVR_STKJRNL_ITEM
(
	SJIID INT IDENTITY(1,1) NOT NULL,
	SJRID INT NOT NULL,
	ISSUE_RECEIPT BIT NOT NULL,
	ITMID INT NOT NULL,
	ADDNLDESC VARCHAR(150)  NULL,
	ITMQTY NUMERIC(11, 4) NOT NULL,
	ALTITMQTY NUMERIC(11, 4) NULL,
	UOMID INT NOT NULL,
	RATE NUMERIC(17, 3) NULL,
	AMOUNT NUMERIC(17, 3) NULL,
	PHYSICALSTKQTY NUMERIC(11, 4) NULL,
	ALTPHYSICALSTKQTY NUMERIC(11, 4) NULL,
	REASON VARCHAR(100)  NULL,
	PRIMARY KEY (SJIID ASC)
)
GO
CREATE TABLE ACC_COSTCENTRE
(
	COSTCENTREID INT IDENTITY(1,1) NOT NULL,
	COSTCENTRENAME VARCHAR(52)  NULL,
	COSTCENTREALTNAME VARCHAR(52)  NULL,
	PRIMARY KEY(COSTCENTREID ASC)
)
GO
CREATE TABLE ACC_PLGROUP
(
	GID INT NOT NULL,
	PLGROUPTYPE TINYINT NULL
)
GO
CREATE TABLE ACC_DEDUCTOR
(
	DEDUCTORNAME VARCHAR(75)  NOT NULL,
	BRANCH VARCHAR(75)  NULL,
	ADDRESS1 VARCHAR(25)  NOT NULL,
	ADDRESS2 VARCHAR(25)  NULL,
	ADDRESS3 VARCHAR(25)  NULL,
	ADDRESS4 VARCHAR(25)  NULL,
	ADDRESS5 VARCHAR(25)  NULL,
	STATEID TINYINT NOT NULL,
	PINCODE INT NULL,
	ADDRESSCHANGED BIT NOT NULL,
	STDCODE VARCHAR(5)  NULL,
	TELEPHONE VARCHAR(10)  NULL,
	FAX VARCHAR(10)  NULL,
	EMAILID VARCHAR(75)  NULL,
	PAN VARCHAR(10)  NOT NULL,
	TANNO VARCHAR(10)  NOT NULL,
	ISTDSASSESSEE BIT NULL,
	STATUSID BIT NULL,
	DEDUCTORTYPE TINYINT NULL
)
GO
CREATE TABLE IVR_BATCH
(
	BATID INT IDENTITY(1,1) NOT NULL,
	ITMID INT NOT NULL,
	BATNUM VARCHAR(15)  NOT NULL,
	BATMFGDATE SMALLDATETIME NULL,
	BATEXPIRYDATE SMALLDATETIME NULL,
	BATREMARKS VARCHAR(100)  NULL,
	CONSTRAINT PK_IVR_BATCH PRIMARY KEY (BATID ASC),
	UNIQUE NONCLUSTERED(ITMID ASC,	BATNUM ASC)
)
GO
CREATE TABLE ACC_RESPONSIBLEPERSON
(
	PERSONNAME VARCHAR(75)  NOT NULL,
	GENDER BIT NOT NULL,
	DESIGNATION VARCHAR(20)  NULL,
	FATHERNAME VARCHAR(75)  NULL,
	ADDRESS1 VARCHAR(25)  NOT NULL,
	ADDRESS2 VARCHAR(25)  NULL,
	ADDRESS3 VARCHAR(25)  NULL,
	ADDRESS4 VARCHAR(25)  NULL,
	ADDRESS5 VARCHAR(25)  NULL,
	STATEID TINYINT NOT NULL,
	PINCODE INT NULL,
	ADDRESSCHANGED BIT NOT NULL,
	STDCODE VARCHAR(5)  NULL,
	TELEPHONE VARCHAR(10)  NULL,
	FAX VARCHAR(10)  NULL,
	EMAILID VARCHAR(75)  NULL
)
GO

CREATE TABLE USERGROUP
(
	GROUPID BIGINT IDENTITY(1,1) NOT NULL,
	GROUPNAME VARCHAR(50)  NULL,
	GROUPDESCRIPTION VARCHAR(50)  NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE VARCHAR(50)  NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE VARCHAR(50)  NULL,
	PRIMARY KEY (GROUPID ASC)
)
GO
CREATE TABLE ACC_GRPMAST
(
	GID INT IDENTITY(0,1) NOT NULL,
	PID INT NOT NULL,
	GROUPTREEID VARCHAR(30)  NULL,
	SECTOR TINYINT NULL,
	GNAME VARCHAR(52)  NOT NULL,
	GANAME VARCHAR(52)  NULL,
	PREDEFINED BIT NOT NULL,
	BEHAVIOURHEAD BIT NULL,
	BEHAVIOURID SMALLINT NULL,
	CREATED SMALLDATETIME NULL,
	MODIFIED SMALLDATETIME NULL,
	CREATEDBY SMALLINT NULL,
	MODIFIEDBY SMALLINT NULL,
	SCHNAME VARCHAR(15)  NULL,
	CDATE DATETIME NULL,
	CNAME VARCHAR(50)  NULL,
	EDATE DATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	PRIMARY KEY (GID ASC)
)
GO
CREATE TABLE IVR_BOM
(
	BOMID INT IDENTITY(1,1) NOT NULL,
	ITMID INT NOT NULL,
	ITMQTY NUMERIC(11, 4) NOT NULL,
	BOMREMARKS VARCHAR(100)  NULL,
	BOMACTIVE BIT NULL,
	EDITINTRAN BIT NULL,
	CNAME NVARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NVARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (BOMID ASC)
)
GO
CREATE TABLE ACC_LEDMAST
(
	LID INT IDENTITY(1,1) NOT NULL,
	PGID INT NOT NULL,
	PLID INT NULL,
	LNAME VARCHAR(52)  NOT NULL,
	LANAME VARCHAR(52)  NULL,
	ACTOPENING NUMERIC(17, 3) NULL,
	BILLWISE BIT NOT NULL,
	ALWSUB BIT NOT NULL,
	TAXAPPLY BIT NOT NULL,
	COSTCENTREAPPLY BIT NOT NULL,
	TDSAPPLY BIT NOT NULL,
	STAPPLY BIT NOT NULL,
	CREATED SMALLDATETIME NULL,
	MODIFIED SMALLDATETIME NULL,
	CREATEDBY SMALLINT NULL,
	MODIFIEDBY SMALLINT NULL,
	TRANSPORTER BIT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NCHAR(10)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (LID ASC)	
)
GO
CREATE TABLE IVR_BOMITEM
(
	BOIID INT IDENTITY(1,1) NOT NULL,
	BOMID INT NOT NULL,
	ITMID INT NOT NULL,
	ITMQTY NUMERIC(11, 4) NOT NULL,
	UOMID INT NOT NULL,
	CNAME NVARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NVARCHAR(50)  NULL,
	EDATE NVARCHAR(50)  NULL,
	PRIMARY KEY (BOIID ASC)
)
GO
CREATE TABLE IVR_ITEMOPENBAL_TIM
(
	ITMID INT NOT NULL,
	LENGTH_UOMID INT NULL,
	GIRTH_UOMID INT NULL,
	WIDTH_UOMID INT NULL,
	THICKNESS_UOMID INT NULL,
	PRIMARY KEY (ITMID ASC)

)
GO

CREATE TABLE ACC_SECUSERRULES
(
	USERID INT NOT NULL,
	MODID INT NOT NULL,
	RIGHTS INT NULL,
	PRIMARY KEY CLUSTERED(	MODID ASC,	USERID ASC)
)
GO
CREATE TABLE IVR_ITEM
(
	ITMID INT IDENTITY(1,1) NOT NULL,
	ITMCODE VARCHAR(25)  NOT NULL,
	ITMACTIVE BIT NOT NULL,
	ITMDESC VARCHAR(100)  NULL,
	ITMALTDESC VARCHAR(100)  NULL,
	ITMADDDESC VARCHAR(100)  NULL,
	IGRID INT NOT NULL,
	ICAID INT NOT NULL,
	STOCKTYPEID TINYINT NOT NULL,
	OPENINGSTOCK FLOAT NOT NULL,
	INPUTTAX BIT NULL,
	PRIMARY_UOMID INT NOT NULL,
	TCS BIT NULL,
	TCS_TXMASID SMALLINT NULL,
	UPCSKUHSNCODE VARCHAR(20)  NULL,
	MINQTY NUMERIC(11, 4) NULL,
	REORDERQTY NUMERIC(11, 4) NULL,
	MAXQTY NUMERIC(11, 4) NULL,
	ITMPRICE NUMERIC(17, 3) NULL,
	ITMDISCOUNTPER NUMERIC(6, 3) NULL,
	ITMBATCH BIT NULL,
	ITMBATCHOPT TINYINT NULL,
	PRICEONALTUNIT BIT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (ITMID ASC),
	UNIQUE(ITMDESC ASC)
)
GO
CREATE TABLE IVR_TRANFORMAT_TARIFF
(
	TFOID INT NOT NULL,
	HEADING VARCHAR(10)  NULL,
	SUBHEADING VARCHAR(10)  NULL,
	TARIFFDESCRIPTION VARCHAR(250)  NULL
)
GO
CREATE TABLE ACC_SECPROJECTGROUP
(
	PROJECTTYPE INT NOT NULL,
	PROJECTTYPENAME VARCHAR(50)  NULL,
  PRIMARY KEY (PROJECTTYPE ASC)
)
GO
CREATE TABLE IVR_ITEMOPENBAL_TIMDET
(
	OBID INT NOT NULL,
	LOGNUM VARCHAR(15)  NULL,
	TIMLENGTH NUMERIC(11, 4) NULL,
	GIRTH NUMERIC(11, 4) NULL,
	WIDTH NUMERIC(11, 4) NULL,
	THICKNESS NUMERIC(11, 4) NULL,
	NOOFPCS NUMERIC(11, 4) NOT NULL,
	EDITQTY BIT NOT NULL,
 PRIMARY KEY (OBID ASC)
)
GO
CREATE TABLE ACC_SECMODULES
(
	MODID INT NOT NULL,
	MODNAME VARCHAR(100)  NOT NULL,
	MODDESC VARCHAR(100)  NULL,
	PROJECTTYPE INT NOT NULL,
 PRIMARY KEY (MODID ASC)
	
)
GO
CREATE TABLE ACC_BTYPE
(
	BTYPEID TINYINT IDENTITY(1,1) NOT NULL,
	BTYPENAME VARCHAR(50)  NULL,
	PRIMARY KEY (BTYPEID ASC)
)
GO
CREATE TABLE IVR_ITEMCATEGORY
(
	ICAID INT IDENTITY(1,1) NOT NULL,
	ICANAME VARCHAR(30)  NOT NULL,
	ICAPREDEF BIT NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	PRIMARY KEY (ICAID ASC),
	UNIQUE (ICANAME ASC)
)
GO
CREATE TABLE ACC_COMPSTATUS
(
	COMPSTATUSID TINYINT IDENTITY(1,1) NOT NULL,
	COMPSTATUSNAME VARCHAR(50)  NOT NULL,
	PRIMARY KEY (COMPSTATUSID ASC)
)
GO
CREATE TABLE ACC_SECGROUPRULES
(
	GROUPID INT NOT NULL,
	MODID INT NOT NULL,
	RIGHTS INT NULL
)
GO
CREATE TABLE IVR_UOM
(
	UOMID INT IDENTITY(1,1) NOT NULL,
	UOMNAME VARCHAR(30)  NOT NULL,
	UOMSYMBOL VARCHAR(30)  NOT NULL,
	PRIMARY_UOMID INT NULL,
	CONVFACTOR NUMERIC(11, 4) NULL,
	QTYDECIMALPLACES TINYINT NULL,
	UNITUSAGETYPE TINYINT NOT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY (UOMID ASC),
	UNIQUE NONCLUSTERED(UOMNAME ASC,UOMSYMBOL ASC)
)
GO
CREATE TABLE ACC_REFDETAILS
(
	REFSERIAL INT IDENTITY(1,1) NOT NULL,
	PARENTREF INT NOT NULL,
	VOUSERIAL INT NOT NULL,
	REFTYPE TINYINT NOT NULL,
	REFERENCE VARCHAR(MAX)  NULL,
	REFDATE SMALLDATETIME NULL,
	CRDAYS SMALLINT NULL,
	REFAMOUNT NUMERIC(17, 3) NULL,
	ISTDSDEDUCTED BIT NULL,
	OSREMARKS VARCHAR(250)  NULL,
 PRIMARY KEY (REFSERIAL ASC)
)
GO

CREATE TABLE IVR_ITEMGROUP
(
	IGRID INT IDENTITY(1,1) NOT NULL,
	IGRNAME VARCHAR(30)  NOT NULL,
	IGRALTNAME VARCHAR(30)  NULL,
	PARENT_IGRID INT NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	PRIMARY KEY (IGRID ASC),
	UNIQUE (IGRNAME ASC)
)
GO
CREATE TABLE IVR_WAREHOUSE(
	WHSID INT IDENTITY(1,1) NOT NULL,
	WHSLOCATION VARCHAR(30)  NULL,
	PARENT_WHSID INT NULL,
	WHSADD1 VARCHAR(250)  NULL,
	WHSADD2 VARCHAR(250)  NULL,
	WHSADD3 VARCHAR(250)  NULL,
	WHSADD4 VARCHAR(250)  NULL,
	WHSCITY VARCHAR(75)  NULL,
	WHSSTATE VARCHAR(5)  NULL,
	WHSCOUNTRY VARCHAR(5)  NULL,
	WHSPIN VARCHAR(50)  NULL,
	WHSPHONE VARCHAR(25)  NULL,
	WHSFAX VARCHAR(25)  NULL,
	WHSEMAIL VARCHAR(60)  NULL,
	WHSREMARKS VARCHAR(150)  NULL,
	WHSACTIVE BIT NOT NULL,
	CNAME NVARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME NVARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
 PRIMARY KEY (WHSID ASC)
)
GO

CREATE TABLE MAS_STATE
(
	STATEID TINYINT IDENTITY(1,1) NOT NULL,
	STATECODE TINYINT NULL,
	COUNTRYID TINYINT NULL,
	STATENAME NVARCHAR(100)  NULL,
 PRIMARY KEY (STATEID ASC)
)
GO
CREATE TABLE ACC_COSTCENTRECLASSDET
(
	SLNO INT IDENTITY(1,1) NOT NULL,
	CLASSID INT NOT NULL,
	COSTCENTREID INT NOT NULL,
	RATE NUMERIC(6, 3) NULL,
	REMARKS VARCHAR(100)  NULL,
	PRIMARY KEY CLUSTERED (CLASSID ASC,COSTCENTREID ASC)
)
GO
CREATE TABLE ACC_VOUCHERS
(
	TRANID INT IDENTITY(1,1) NOT NULL,
	TRANTYPE INT NOT NULL,
	VOUNO VARCHAR(52)  NOT NULL,
	FINYEAR VARCHAR(50)  NOT NULL,
	ABBRV VARCHAR(52)  NULL,
	REFNO VARCHAR(52)  NULL,
	CASHVOUCHER BIT NOT NULL,
	VOUDATE SMALLDATETIME NOT NULL,
	NARRATION VARCHAR(250)  NULL,
	CRDAYS INT NULL,
	CHEQUENO VARCHAR(52)  NULL,
	CREATEDDATE SMALLDATETIME NULL,
	CREATEDBY VARCHAR(52)  NULL,
	MODIFIEDDATE SMALLDATETIME NULL,
	MODIFIEDBY VARCHAR(52)  NULL,
	ISCANCELLED BIT NOT NULL,
	TDSRECNO INT NULL,
	TDSQUARTER TINYINT NULL,
	COSTCENTRECLASSID INT NULL,
  PRIMARY KEY (TRANID ASC)
)
GO

CREATE TABLE IVC_INVOICE_MAIN
(
	INVOICEID INT IDENTITY(1,1) NOT NULL,
	TRANID INT NOT NULL,
	FORMATID INT NOT NULL,
	CUSTOMERLEDGERID INT NOT NULL,
	SERVICEORDER VARCHAR(50)  NULL,
	COMMENTS VARCHAR(100)  NULL,
	CHECKEDBY VARCHAR(52)  NULL,
	PREPAREDBY VARCHAR(52)  NULL,
	SERVICEDBY VARCHAR(52)  NULL,
	ISTDSAPPLIED BIT NULL,
	TDSREFTRANID INT NULL,
	ISROUNDOFFEDITABLE BIT NOT NULL,
	PRIMARY KEY (INVOICEID ASC),
	UNIQUE (TRANID ASC)
)
GO
CREATE TABLE IVC_RECEIPT_MAIN
(
	RECEIPTID INT IDENTITY(1,1) NOT NULL,
	TRANID INT NOT NULL,
	FORMATID INT NOT NULL,
	CUSTOMERLEDGERID INT NOT NULL,
	TOTALAMT NUMERIC(17, 3) NULL,
	MODEOFRECEIPT TINYINT NULL,
	DDCHQNO VARCHAR(14)  NULL,
	DDCHQBANK VARCHAR(250)  NULL,
	DDCHQDATE DATETIME NULL,
	CARDTYPE VARCHAR(150)  NULL,
	ISSUEDBY VARCHAR(150)  NULL,
	ACCTYPE VARCHAR(25)  NULL,
	ACCNO INT NULL,
	REMITINGBANKID INT NULL,
	CHECKEDBY VARCHAR(50)  NULL,
	PREPAREDBY VARCHAR(50)  NULL,
	SERVICEALLOCATIONTYPE BIT NOT NULL,
	PRIMARY KEY (RECEIPTID ASC),
	UNIQUE (TRANID ASC)
)
GO
CREATE TABLE IVC_DEBITNOTE_MAIN
(
	DEBITNOTEID INT IDENTITY(1,1) NOT NULL,
	TRANID INT NOT NULL,
	FORMATID INT NOT NULL,
	CUSTOMERLEDGERID INT NOT NULL,
	REMARKS VARCHAR(50)  NULL,
	CHECKEDBY VARCHAR(50)  NULL,
	PREPAREDBY VARCHAR(50)  NULL,
	ISTDSAPPLIED BIT NOT NULL,
	TDSREFTRANID INT NULL,
	DEBITENOTETOWARDS INT NULL,
	PRIMARY KEY (DEBITNOTEID ASC),
	UNIQUE (TRANID ASC)
)
GO
CREATE TABLE IVC_CREDITNOTE_MAIN
(
	CREDITNOTEID INT IDENTITY(1,1) NOT NULL,
	TRANID INT NOT NULL,
	FORMATID INT NOT NULL,
	CUSTOMERLEDGERID INT NOT NULL,
	REMARKS VARCHAR(250)  NULL,
	CHECKEDBY VARCHAR(50)  NULL,
	PREPAREDBY VARCHAR(50)  NULL,
	ISTDSAPPLIED BIT NULL,
	TDSREFTRANID INT NULL,
	ISSALESRETURN BIT NULL,
	PRIMARY KEY (CREDITNOTEID ASC),
	UNIQUE (TRANID ASC)
)
GO
CREATE TABLE IVC_SERVICEMASTER
(
	SERVICEID INT IDENTITY(1,1) NOT NULL,
	SERVICENAME VARCHAR(50)  NOT NULL,
	SERVICECATEGORYID INT NULL,
	ADDDESC VARCHAR(250)  NULL,
	TAXABILITY TINYINT NOT NULL,
	LEDGERID INT NOT NULL,
	SERVICECLASSIFICATIONID INT NULL,
	EXPENSEREIMURSEMENT TINYINT NULL,
	TAXTYPEID INT NULL,
	TAXCALON SMALLINT NULL,
	SUBCLASS TINYINT NULL,
	ABATEMENTYN BIT NULL,
	VATEXMPRATE NUMERIC(6, 3) NULL,
	SERVICECHARGERATE NUMERIC(6, 3) NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
 PRIMARY KEY (SERVICEID ASC)
)
GO
CREATE TABLE IVC_CREDITNOTE_CHILD
(
	CREDITNOTECHILDID INT IDENTITY(1,1) NOT NULL,
	CREDITNOTEID INT NOT NULL,
	REFERENCETRANID INT NOT NULL,
	REFERENCECHILDID INT NOT NULL,
	REFERENCEID INT NOT NULL,
	SERVICEID INT NOT NULL,
	ADDDESC VARCHAR(250)  NULL,
	TDSAMOUNT NUMERIC(17, 3) NULL,
	WRITEOFFAMT NUMERIC(17, 3) NULL,
	WRITEOFFTAXABLEAMT NUMERIC(17, 3) NULL,
	WRITEOFFABATEMENTAMT NUMERIC(17, 3) NULL,
	WRITEOFFSERVICECHARGEAMT NUMERIC(17, 3) NULL,
	DISCOUNTAMT NUMERIC(17, 3) NULL,
	DISCOUNTTAXABLEAMT NUMERIC(17, 3) NULL,
	DISCOUNTABATEMENTAMT NUMERIC(17, 3) NULL,
	DISCOUNTSERVICECHARGEAMT NUMERIC(17, 3) NULL,
	AMOUNT NUMERIC(17, 3) NULL,
	PRIMARY KEY (CREDITNOTECHILDID ASC)
)
GO
CREATE TABLE ACC_VOUDETAILS
(
	VOUSERIAL INT IDENTITY(1,1) NOT NULL,
	TRANID INT NOT NULL,
	LID INT NOT NULL,
	AMOUNT NUMERIC(17, 3) NULL,
	ISRECONCILED BIT NOT NULL,
	RECDATE SMALLDATETIME NULL,
	REMARKS VARCHAR(250)  NULL,
	NARRATION VARCHAR(250)  NULL,
 PRIMARY KEY (VOUSERIAL ASC)
)
GO
CREATE TABLE IVC_TDSCERTIFICATE
(
	TDSCERTIFICATEID INT IDENTITY(1,1) NOT NULL,
	REFERENCETRANID INT NOT NULL,
	REFERENCECHILDID INT NOT NULL,
	CERTIFICATENUMBER VARCHAR(150)  NULL,
	RECEIVEDDATE DATETIME NULL,
	REMARKS VARCHAR(250)  NULL,
 PRIMARY KEY (TDSCERTIFICATEID ASC)
)
GO
CREATE TABLE IVC_REPORTSETTINGS
(
	SETTINGID INT IDENTITY(1,1) NOT NULL,
	TRANID INT NOT NULL,
	CAPTIONYN BIT NULL,
	CAPTION VARCHAR(250)  NULL,
	FIRMNAME VARCHAR(255)  NULL,
	INFORMATIONYN BIT NULL,
	INFORMATION VARCHAR(250)  NULL,
	NOTEYN BIT NULL,
	NOTE VARCHAR(250)  NULL,
	LOGOYN BIT NULL,
	LOGOPATH VARCHAR(MAX)  NULL,
	PAGESETYN BIT NULL,
	HEADMARGIN NUMERIC(3, 2) NULL,
	FOOTMARGIN NUMERIC(3, 2) NULL,
	PAPERSIZE BIT NULL,
	NOOFCOPY SMALLINT NULL,
	FIRMNAMEADDRYN BIT NULL,
	CNAMEADDRYN BIT NULL,
	PANYN BIT NULL,
	STREGNOYN BIT NULL,
	OUTSUMMARYYN BIT NULL,
	SERVICEDBYYN BIT NULL,
	NARRATIONYN BIT NULL,
	PREPAREDBYYN BIT NULL,
	CHECKEDBYYN BIT NULL,
	REFNOYN BIT NULL,
 PRIMARY KEY (SETTINGID ASC)
)
GO
CREATE TABLE IVR_TRAN_MAIN
(
	TRNID INT IDENTITY(1,1) NOT NULL,
	TRANREFERENCEID INT NULL,
	TRANTYPEID TINYINT NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	POID INT NULL,
	INVOICENO VARCHAR(50)  NULL,
	TFOID INT NOT NULL,
	TRNNUM VARCHAR(10)  NOT NULL,
	TRNDATE DATETIME NOT NULL,
	VENDCUST_LID INT NOT NULL,
	TAX_MAINCLASSID SMALLINT NOT NULL,
	TRNSTATUS VARCHAR(20)  NOT NULL,
	EFFECTIVEDATE SMALLDATETIME NULL,
	MODEOFPAY TINYINT NULL,
	CREDITPERIOD SMALLINT NULL,
	SHIPTO_VSTID INT NULL,
	SPGID INT NULL,
	SPRID INT NULL,
	DCTAX_SUBCLASSID SMALLINT NULL,
	REFNUM VARCHAR(13)  NULL,
	REFDATE SMALLDATETIME NULL,
	SURCHARGE BIT NULL,
	DC_CATEGORYCODE VARCHAR(10)  NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	CONSTRAINT PK_IVR_TRAN_MAIN PRIMARY KEY(TRNID ASC)
)
GO
CREATE TABLE IVC_TDSMANAGEMENT_MAIN
(
	TDSMANAGEMENTID INT IDENTITY(1,1) NOT NULL,
	TRANID INT NOT NULL,
	CUSTOMERLEDGERID INT NOT NULL,
	PRIMARY KEY (TDSMANAGEMENTID ASC)
)
GO

CREATE TABLE IVC_TDSMANAGEMENT_CHILD
(
	TDSMANAGEMENTCHILDID INT IDENTITY(1,1) NOT NULL,
	TDSMANAGEMENTID INT NOT NULL,
	REFERENCETRANID INT NOT NULL,
	REFERENCECHILDID INT NOT NULL,
	SERVICEID INT NOT NULL,
	REFERENCEID INT NOT NULL,
	AMOUNT NUMERIC(17, 3) NULL,
	CESS1RATE NUMERIC(6, 3) NULL,
	CESS1AMT NUMERIC(17, 3) NULL,
	CESS2RATE NUMERIC(6, 3) NULL,
	CESS2AMT NUMERIC(17, 3) NULL,
	SERVICERATE NUMERIC(6, 3) NULL,
	SERVICEAMT NUMERIC(17, 3) NULL,
	TDSTAXABLEAMT NUMERIC(17, 3) NULL,
	ABATEMENTAMT NUMERIC(17, 3) NULL,
	SERVICECHARGEAMT NUMERIC(17, 3) NULL,
 PRIMARY KEY(TDSMANAGEMENTCHILDID ASC)
)
GO
CREATE TABLE IVC_RECEIPT_CHILD
(
	RECEIPTCHILDID INT IDENTITY(1,1) NOT NULL,
	RECEIPTID INT NOT NULL,
	REFERENCETRANID INT NULL,
	REFERENCECHILDID INT NULL,
	REFERENCEID INT NULL,
	SERVICEID INT NOT NULL,
	RECEIPTAMOUNT NUMERIC(17, 3) NULL,
	DOMESTIC NUMERIC(17, 3) NULL,
	EXEMPTED NUMERIC(17, 3) NULL,
	EXPORTED NUMERIC(17, 3) NULL,
	RECEIPTOTHER NUMERIC(17, 3) NULL,
	NONTAXAMT NUMERIC(17, 3) NULL,
	CESS1RATE NUMERIC(6, 3) NULL,
	CESS1AMT NUMERIC(17, 3) NULL,
	CESS2RATE NUMERIC(6, 3) NULL,
	CESS2AMT NUMERIC(17, 3) NULL,
	SERVICERATE NUMERIC(6, 3) NULL,
	SERVICEAMT NUMERIC(17, 3) NULL,
	TAXABLEAMT NUMERIC(17, 3) NULL,
	ABATEMENTAMT NUMERIC(17, 3) NULL,
	SERVICECHARGEAMT NUMERIC(17, 3) NULL,
	REFERENCETYPE TINYINT NULL,
	PRIMARY KEY (RECEIPTCHILDID ASC)
)
GO
CREATE TABLE IVC_DEBITNOTE_CHILD
(
	DEBITNOTECHILDID INT IDENTITY(1,1) NOT NULL,
	DEBITNOTEID INT NOT NULL,
	SERVICEID INT NOT NULL,
	ADDDESC VARCHAR(250)  NULL,
	SERVICETAXAMT NUMERIC(17, 3) NULL,
	EDUCESS1AMT NUMERIC(17, 3) NULL,
	EDUCESS2AMT NUMERIC(17, 3) NULL,
	AMOUNT NUMERIC(17, 3) NULL,
	TOTALAMOUNT NUMERIC(17, 3) NULL,
	PRIMARY KEY(DEBITNOTECHILDID ASC)
)
GO
CREATE TABLE IVC_DEBITNOTE_TOTAL
(
	DEBITNOTEID INT NOT NULL,
	TAXABLEAMT NUMERIC(17, 3) NULL,
	NONTAXABLEAMT NUMERIC(17, 3) NULL,
	EXPREIMURSEMENTAMT NUMERIC(17, 3) NULL,
	SERVICETAXRATE NUMERIC(6, 3) NULL,
	SERVICETAXAMT NUMERIC(17, 3) NULL,
	EDUCESS1RATE NUMERIC(6, 3) NULL,
	EDUCESS1AMT NUMERIC(17, 3) NULL,
	EDUCESS2RATE NUMERIC(6, 3) NULL,
	EDUCESS2AMT NUMERIC(17, 9) NULL,
	TOTAL NUMERIC(17, 3) NULL,
	PRIMARY KEY (DEBITNOTEID ASC)
)
GO
CREATE TABLE IVC_INVOICE_TOTAL
(
	INVOICEID INT NOT NULL,
	TAXABLEAMT NUMERIC(17, 3) NULL,
	NONTAXABLEAMT NUMERIC(17, 3) NULL,
	EXPREIMURSEMENTAMT NUMERIC(17, 3) NULL,
	TOTALAMTBEFTAX NUMERIC(17, 3) NULL,
	SERVICETAXRATE NUMERIC(6, 3) NULL,
	SERVICETAXAMT NUMERIC(17, 3) NULL,
	EDUCESS1RATE NUMERIC(6, 3) NULL,
	EDUCESS1AMT NUMERIC(17, 3) NULL,
	EDUCESS2RATE NUMERIC(6, 3) NULL,
	EDUCESS2AMT NUMERIC(17, 3) NULL,
	LUXURYTAXRATE NUMERIC(6, 3) NULL,
	LUXURYTAXAMT NUMERIC(17, 3) NULL,
	ROUNDOFFAMT NUMERIC(17, 3) NULL,
	EDITEDROUNDOFFAMT NUMERIC(17, 3) NULL,
	TAXDISCOUNT NUMERIC(17, 3) NULL,
	NONTAXDISCOUNT NUMERIC(17, 3) NULL,
	TAXDISRATE NUMERIC(6, 3) NULL,
	NONTAXDISRATE NUMERIC(6, 3) NULL,
	ABTMNTAMT NUMERIC(17, 3) NULL,
	SERVICECHARGEAMT NUMERIC(17, 3) NULL,
	VATAMT NUMERIC(17, 3) NULL,
	TOTALAMT NUMERIC(17, 3) NULL,
	CURRENTNETTDS NUMERIC(17, 3) NULL,
	CURRENTNETAMTPAYABLE NUMERIC(17, 3) NULL,
	CURRENTEFFRATE NUMERIC(6, 3) NULL,
	PREVIOUSNETTDS NUMERIC(17, 3) NULL,
	PREVIOUSNETAMTPAYABLE NUMERIC(17, 3) NULL,
	PREVIOUSEFFRATE NUMERIC(6, 3) NULL,
	NETTDS NUMERIC(17, 3) NULL,
	NETAMTPAYABLE NUMERIC(17, 3) NULL,
	PRIMARY KEY (INVOICEID ASC)
)
GO
CREATE TABLE IVC_INVOICE_CHILD
(
	INVOICECHILDID INT IDENTITY(1,1) NOT NULL,
	INVOICEID INT NOT NULL,
	SERVICEID INT NOT NULL,
	ADDDESC VARCHAR(250)  NULL,
	YEARREF VARCHAR(50)  NULL,
	UNIT NUMERIC(10, 3) NULL,
	RATE NUMERIC(17, 3) NULL,
	TAXABLEAMT NUMERIC(17, 3) NULL,
	SERVICETAXAMT NUMERIC(17, 3) NULL,
	CESS1AMT NUMERIC(17, 3) NULL,
	CESS2AMT NUMERIC(17, 3) NULL,
	LTAMT NUMERIC(17, 3) NULL,
	DISCOUNT NUMERIC(17, 3) NULL,
	DISCOUNTRATE NUMERIC(6, 3) NULL,
	TAXABLEAMTAFTERDIS NUMERIC(17, 3) NULL,
	SERVICECHARGERATE NUMERIC(6, 3) NULL,
	SERVICECHARGEAMT NUMERIC(17, 3) NULL,
	ABTMNTAMT NUMERIC(17, 3) NULL,
	VATAMT NUMERIC(17, 3) NULL,
	TOTALAMT NUMERIC(17, 3) NULL,
	UNIT2 NUMERIC(10, 3) NULL,
	UNIT3 NUMERIC(10, 3) NULL,
	UNIT4 NUMERIC(10, 3) NULL,
	UOM VARCHAR(50)  NULL,
	CURRENTNETTDS NUMERIC(17, 3) NULL,
	PREVIOUSNETTDS NUMERIC(17, 3) NULL,
	NETTDS NUMERIC(17, 3) NULL,
  PRIMARY KEY (INVOICECHILDID ASC)
)
GO
CREATE TABLE ACC_TAXMAINCLASS
(
	MAINCLASSID SMALLINT IDENTITY(1,1) NOT NULL,
	TAXTYPEID TINYINT NOT NULL,
	MAINCLASSNAME VARCHAR(60)  NULL,
	DONTUSEINTAXMASTER BIT NOT NULL,
	SECTIONCODE VARCHAR(5)  NULL,
	DEFTHRESHOLD NUMERIC(17, 3) NULL,
	DEFTHRESHOLDFORYEAR NUMERIC(17, 3) NULL,
	PRIMARY KEY (MAINCLASSID ASC)
)
GO
CREATE TABLE ACC_TAXMASTER
(
	TAXMASTERID SMALLINT IDENTITY(1,1) NOT NULL,
	MAINCLASSID SMALLINT NOT NULL,
	SUBCLASSID SMALLINT NULL,
	USEINTRANSACTION BIT NULL,
	FORMNAME VARCHAR(5)  NULL,
	DEFTAXRATE NUMERIC(6, 3) NULL,
	SHORTNAME VARCHAR(10)  NOT NULL,
	PRIMARY KEY (TAXMASTERID ASC)
)
GO
CREATE TABLE IVC_CREDITNOTE_TOTAL
(
	CREDITNOTEID INT NOT NULL,
	TAXABLEAMT NUMERIC(17, 3) NULL,
	NONTAXABLEAMT NUMERIC(17, 3) NULL,
	SERVICETAXRATE NUMERIC(17, 3) NULL,
	SERVICETAXAMT NUMERIC(17, 3) NULL,
	EDUCESS1RATE NUMERIC(17, 3) NULL,
	EDUCESS1AMT NUMERIC(17, 3) NULL,
	EDUCESS2RATE NUMERIC(17, 3) NULL,
	EDUCESS2AMT NUMERIC(17, 3) NULL,
	TOTAL NUMERIC(17, 3) NULL,
	TDSAMOUNT NUMERIC(17, 3) NULL,
	WRITEOFFAMT NUMERIC(17, 3) NULL,
	DISCOUNTAMT NUMERIC(17, 3) NULL,
	ADDITIONALTAXAMT NUMERIC(17, 3) NULL,
 PRIMARY KEY(CREDITNOTEID ASC)
)
GO
CREATE TABLE ACC_TAXDETAILS
(
	TXDETID INT IDENTITY(1,1) NOT NULL,
	TAXMASTERID SMALLINT NOT NULL,
	EFFFROMDATE SMALLDATETIME NOT NULL,
	EFFTODATE DATETIME NOT NULL,
	TAXACTIVE BIT NOT NULL,
	TAXRATE NUMERIC(6, 3) NULL,
	TAXRATE_LID INT NULL,
	PURCSALE_LID INT NULL,
	THRESHOLD NUMERIC(17, 3) NULL,
	THRESHOLDFORYEAR NUMERIC(17, 3) NULL,
  PRIMARY KEY (TXDETID ASC)
)
GO
CREATE TABLE ACC_TAXADDITIONAL
(
	TXADDID INT IDENTITY(1,1) NOT NULL,
	MAIN_TXDETID INT NOT NULL,
	ADDITIONAL_TAXMASTERID SMALLINT NOT NULL,
	TAXRATE NUMERIC(6, 3) NULL,
	TAXRATE_LID INT NULL,
  PRIMARY KEY (TXADDID ASC)
)
GO
CREATE TABLE IVC_CUSTOMER_PREFERENCE_PARENT
(
	CUSTOMERPREID INT IDENTITY(1,1) NOT NULL,
	CUSTOMERLEDGERID INT NOT NULL,
	FORMATID INT NOT NULL,
	CRDAYS INT NULL,
	PRIMARY KEY (CUSTOMERPREID ASC)
)
GO
CREATE TABLE IVC_CUSTOMER_PREFERENCE_CHILD
(
	CUSTOMERPRECHILDID INT IDENTITY(1,1) NOT NULL,
	CUSTOMERPREID INT NOT NULL,
	SERVICEID INT NOT NULL,
	RATE NUMERIC(17, 3) NULL,
	UNIT NUMERIC(17, 3) NULL,
	UNIT2 NUMERIC(17, 3) NULL,
	UNIT3 NUMERIC(17, 3) NULL,
	UNIT4 NUMERIC(17, 3) NULL,
	UOM VARCHAR(50)  NULL,
 PRIMARY KEY (CUSTOMERPRECHILDID ASC)
)
GO

CREATE TABLE IVC_TRANSACTIONFORMAT_ADDUNITS
(
	FORMATID INT NOT NULL,
	UNIT1 BIT NOT NULL,
	UNIT2 BIT NOT NULL,
	UNIT3 BIT NOT NULL,
	UNIT1MAIN_CAPTION VARCHAR(50)  NULL,
	UNIT1_FORMULA VARCHAR(250)  NULL,
	GRSFORMULA VARCHAR(250)  NULL,
	UNIT1_CAPTION VARCHAR(50)  NULL,
	UNIT2_CAPTION VARCHAR(50)  NULL,
	UNIT3_CAPTION VARCHAR(50)  NULL,
	PRIMARY KEY (FORMATID ASC)
)
GO
CREATE TABLE IVC_TRANSACTIONFORMAT_CAPTIONS
(
	FORMATID INT NOT NULL,
	UNIT VARCHAR(50)  NULL,
	RATE VARCHAR(50)  NULL,
	YEARREFERENCE VARCHAR(50)  NULL,
	ADDDESCRIPTION VARCHAR(50)  NULL,
	UOM VARCHAR(50)  NULL,
 PRIMARY KEY (FORMATID ASC)
)
GO
CREATE TABLE IVC_TRANSACTIONFORMAT_TAX_DISCOUNT_DETAILS
(
	FORMATID INT NOT NULL,
	TAXLEVEL BIT NOT NULL,
	DISCOUNTLEVEL TINYINT NOT NULL,
	TAXTYPEID INT NULL,
	TAXCALON TINYINT NULL,
	ITEMTAXTYPE TINYINT NULL,
 PRIMARY KEY (FORMATID ASC)
)
GO
CREATE TABLE IVC_TRANSACTIONFORMAT_HEADOFACCOUNTS
(
	FORMATID INT NOT NULL,
	ROUNDOFF_LEDGERID INT NULL,
	DISCOUNT_LEDGERID INT NULL,
	WRITEOFF_LEDGERID INT NULL,
	TDS_LEDGERID INT NULL,
 PRIMARY KEY (FORMATID ASC)
)
GO
CREATE TABLE IVC_TRANSACTIONFORMAT_POSTBILLING(
	FORMATID INT NOT NULL,
	AMTCESS BIT NOT NULL,
	TDSRATE NUMERIC(6, 3) NULL,
	CESS1RATE NUMERIC(17, 3) NULL,
	CESS2RATE NUMERIC(17, 3) NULL,
	SURCHARGERATE NUMERIC(6, 3) NULL,
	EFFECTIVERATE NUMERIC(6, 3) NULL,
	PRIMARY KEY(FORMATID ASC)
)
GO
CREATE TABLE IVC_TRANSACTIONFORMAT_NUMBERS
(
	TRANNUMID INT IDENTITY(1,1) NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	FORMATID INT NOT NULL,
	NUMBERINGMETHOD BIT NOT NULL,
	PREFIX VARCHAR(10)  NULL,
	STARTNUMBER INT NULL,
	SUFFIX VARCHAR(10)  NULL,
	NUMWIDTH SMALLINT NULL,
	PREFILLZERO BIT NOT NULL,
	RESETYEAR BIT NOT NULL,
 PRIMARY KEY(TRANNUMID ASC)
)
GO
CREATE TABLE IVC_TRANSACTIONFORMAT_REPORTSETTINGS
(
	FORMATID INT NOT NULL,
	CAPTIONYN BIT NULL,
	CAPTION VARCHAR(250)  NULL,
	FIRMNAME VARCHAR(255)  NULL,
	INFORMATIONYN BIT NULL,
	INFORMATION VARCHAR(250)  NULL,
	NOTEYN BIT NULL,
	NOTE VARCHAR(250)  NULL,
	LOGOYN BIT NULL,
	LOGOPATH VARCHAR(MAX)  NULL,
	PAGESETYN BIT NULL,
	HEADMARGIN NUMERIC(3, 2) NULL,
	FOOTMARGIN NUMERIC(3, 2) NULL,
	PAPERSIZE BIT NULL,
	NOOFCOPY SMALLINT NULL,
	FIRMNAMEADDRYN BIT NULL,
	CNAMEADDRYN BIT NULL,
	PANYN BIT NULL,
	STREGNOYN BIT NULL,
	OUTSUMMARYYN BIT NULL,
	SERVICEDBYYN BIT NULL,
	NARRATIONYN BIT NULL,
	PREPAREDBYYN BIT NULL,
	CHECKEDBYYN BIT NULL,
	REFNOYN BIT NULL,
 PRIMARY KEY (FORMATID ASC)
)
GO
CREATE TABLE IVC_CREDITNOTE_TDS
(
	CREDITNOTECHILDID INT NOT NULL,
	CESS1RATE NUMERIC(6, 3) NULL,
	CESS1AMT NUMERIC(17, 3) NULL,
	CESS2RATE NUMERIC(6, 3) NULL,
	CESS2AMT NUMERIC(17, 3) NULL,
	SERVICERATE NUMERIC(6, 3) NULL,
	SERVICEAMT NUMERIC(17, 3) NULL,
	TDS NUMERIC(17, 3) NULL,
	TDSTAXABLEAMT NUMERIC(17, 3) NULL,
	ABATEMENTAMT NUMERIC(17, 3) NULL,
	SERVICECHARGEAMT NUMERIC(17, 3) NULL,
  PRIMARY KEY (CREDITNOTECHILDID ASC)
)
GO
CREATE TABLE IVC_RECEIPT_TDS
(
	RECEIPTCHILDID INT NOT NULL,
	CESS1RATE NUMERIC(6, 3) NULL,
	CESS1AMT NUMERIC(17, 3) NULL,
	CESS2RATE NUMERIC(6, 3) NULL,
	CESS2AMT NUMERIC(17, 3) NULL,
	SERVICERATE NUMERIC(6, 3) NULL,
	SERVICEAMT NUMERIC(17, 3) NULL,
	TDS NUMERIC(17, 3) NULL,
	TDSTAXABLEAMT NUMERIC(17, 3) NULL,
	ABATEMENTAMT NUMERIC(17, 3) NULL,
	SERVICECHARGEAMT NUMERIC(17, 3) NULL,
	WRITEOFF NUMERIC(17, 3) NULL,
	WRITEOFFTAXABLEAMT NUMERIC(17, 3) NULL,
  PRIMARY KEY (RECEIPTCHILDID ASC)
)
GO
CREATE TABLE IVC_REPORTCAPTIONS
(
	CAPTIONID INT IDENTITY(1,1) NOT NULL,
	SETTINGID INT NOT NULL,
	CAPTION VARCHAR(MAX)  NULL,
	PRIMARY KEY (CAPTIONID ASC)
)
GO
CREATE TABLE IVR_TRAN_ITEM
(
	TITID INT IDENTITY(1,1) NOT NULL,
	TRNID INT NOT NULL,
	ITMID INT NOT NULL,
	ADDNDESC VARCHAR(150)  NULL,
	ITMQTY NUMERIC(11, 4) NULL,
	ALTITMQTY NUMERIC(11, 4) NULL,
	UOMID INT NULL,
	RATEINCL NUMERIC(17, 3) NULL,
	RATE NUMERIC(17, 3) NULL,
	GROSSAMT NUMERIC(17, 3) NULL,
	DISCPER NUMERIC(6, 3) NULL,
	DISCAMT NUMERIC(17, 3) NULL,
	CENVATPER NUMERIC(6, 3) NULL,
	CENVATAMT NUMERIC(17, 3) NULL,
	PRIMARYCESSPER NUMERIC(6, 3) NULL,
	PRIMARYCESSAMT NUMERIC(17, 3) NULL,
	HIGHERCESSPER NUMERIC(6, 3) NULL,
	HIGHERCESSAMT NUMERIC(17, 3) NULL,
	NETAMT NUMERIC(17, 3) NULL,
	TAX_TXMASID SMALLINT NULL,
	TAXPER NUMERIC(6, 3) NULL,
	TAXAMT NUMERIC(17, 3) NULL,
	ITMAMT NUMERIC(17, 3) NULL,
	DC_TITID INT NULL,
	ITMPENDINGQTY NUMERIC(11, 4) NULL,
	ITMAMT_LID INT NULL,
	TAXAMT_LID INT NULL,
 PRIMARY KEY (TITID ASC)
)
GO
CREATE TABLE IVR_TRAN_TOTAL
(
	TRNID INT NOT NULL,
	ITEMTOTAL NUMERIC(17, 3) NULL,
	ITEMTOTAL_LID INT NULL,
	DISCOUNTPER NUMERIC(6, 3) NULL,
	DISCOUNTAMT NUMERIC(17, 3) NULL,
	DISCOUNTAMT_LID INT NULL,
	CENVAT_TXMASID INT NULL,
	CENVATPER NUMERIC(6, 3) NULL,
	CENVATAMT NUMERIC(17, 3) NULL,
	CENVAT_LID INT NULL,
	PRIMARYCESSPER NUMERIC(6, 3) NULL,
	PRIMARYCESSAMT NUMERIC(17, 3) NULL,
	PRIMARYCESS_LID INT NULL,
	HIGHERCESSPER NUMERIC(6, 3) NULL,
	HIGHERCESSAMT NUMERIC(17, 3) NULL,
	HIGHERCESS_LID INT NULL,
	TAXABLEAMT NUMERIC(17, 3) NULL,
	TAX_TXMASID SMALLINT NULL,
	TAXPER NUMERIC(6, 3) NULL,
	TAXAMT NUMERIC(17, 3) NULL,
	TAXAMT_LID INT NULL,
	TCSAMT NUMERIC(17, 3) NULL,
	TCSAMT_LID INT NULL,
	RNDOFFAMT NUMERIC(17, 3) NULL,
	RNDOFFAMT_LID INT NULL,
	TRNTOTAL NUMERIC(17, 3) NULL,
	TRNTOTAL_LID INT NULL,
 PRIMARY KEY (TRNID ASC)
)
GO
CREATE TABLE IVR_TRAN_OTHERS
(
	TRNID INT NOT NULL,
	PREPAREDBY VARCHAR(100)  NULL,
	CHECKEDBY VARCHAR(100)  NULL,
	AUTHRSDSIGNAT VARCHAR(100)  NULL,
	NARRATION VARCHAR(150)  NULL,
	NOTE NCHAR(150)  NULL,
	REMARKS VARCHAR(150)  NULL,
	TYPEOFDOCUMENT VARCHAR(100)  NULL,
	TIMEOFINVOICE SMALLDATETIME NULL,
	TIMEOFREMOVALOFGOODS SMALLDATETIME NULL,
	PRIMARY KEY (TRNID ASC)
)
GO
CREATE TABLE IVR_TRAN_ITEMTIM
(
	TITID INT NOT NULL,
	LENGTH_UOMID INT NULL,
	GIRTH_UOMID INT NULL,
	WIDTH_UOMID INT NULL,
	THICKNESS_UOMID INT NULL,
	PRIMARY KEY (TITID ASC)
)
GO
CREATE TABLE IVR_TRAN_ITEMDET(
	TIDID INT IDENTITY(1,1) NOT NULL,
	TITID INT NOT NULL,
	WHSID INT NOT NULL,
	BATID INT NULL,
	DETQTY NUMERIC(11, 4) NOT NULL,
	DETALTQTY NUMERIC(11, 4) NULL,
	WARRANTY SMALLINT NULL,
	WARRANTYPERIOD TINYINT NULL,
 PRIMARY KEY (TIDID ASC)
)
GO
CREATE TABLE ACC_LEDDOCUMENT
(
	DOCID INT IDENTITY(1,1) NOT NULL,
	LID INT NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	DOCPATH VARCHAR(MAX)  NOT NULL,
	REMARKS VARCHAR(MAX)  NULL,
 PRIMARY KEY (DOCID ASC)
)
GO
CREATE TABLE ACC_LEDCUSTOMFIELDS
(
	LID INT NOT NULL,
	FIELD1 VARCHAR(MAX)  NULL,
	FIELD2 VARCHAR(MAX)  NULL,
	FIELD3 VARCHAR(MAX)  NULL,
	FIELD4 VARCHAR(MAX)  NULL,
	FIELD5 VARCHAR(MAX)  NULL,
	FIELD6 VARCHAR(MAX)  NULL,
	FIELD7 VARCHAR(MAX)  NULL,
	FIELD8 VARCHAR(MAX)  NULL,
	FIELD9 VARCHAR(MAX)  NULL,
	FIELD10 VARCHAR(MAX)  NULL
)
GO
CREATE TABLE ACC_LEDNOTES
(
	NOTESID INT IDENTITY(1,1) NOT NULL,
	LID INT NOT NULL,
	FINYEAR SMALLINT NOT NULL,
	NOTES VARCHAR(MAX)  NULL,
 PRIMARY KEY (NOTESID ASC)
)
GO
CREATE TABLE ACC_LEDTAXDETAILS
(
	TAXDETAILID INT IDENTITY(1,1) NOT NULL,
	LID INT NULL,
	TAXTYPEID TINYINT NULL,
	MAINCLASSID SMALLINT NULL,
	SUBCLASSID SMALLINT NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
  PRIMARY KEY(TAXDETAILID ASC)
)
GO

CREATE TABLE ACC_LEDCONTACTDETAILS
(
	CONTACTID INT IDENTITY(1,1) NOT NULL,
	LID INT NOT NULL,
	PERSON VARCHAR(100)  NOT NULL,
	POSITION VARCHAR(60)  NULL,
	PHONENUM VARCHAR(60)  NULL,
	MOBILENUM VARCHAR(60)  NULL,
	EMAIL VARCHAR(60)  NULL,
	FAXNUM VARCHAR(60)  NULL,
	REMARKS VARCHAR(250)  NULL,
	CNAME VARCHAR(50)  NULL,
	CDATE SMALLDATETIME NULL,
	ENAME VARCHAR(50)  NULL,
	EDATE SMALLDATETIME NULL,
	PRIMARY KEY(CONTACTID ASC)
)
GO
CREATE TABLE IVR_ITEMOPENBAL
(
	SLNUM INT IDENTITY(1,1) NOT NULL,
	ITMID INT NOT NULL,
	WHSID INT NOT NULL,
	REFNUM VARCHAR(30)  NULL,
	QUANTITY DECIMAL(18, 3) NOT NULL,
	RATE DECIMAL(18, 3) NOT NULL,
	AMOUNT DECIMAL(18, 3) NOT NULL,
	VENDOR_LID INT NULL,
	BATID INT NULL,
	WARRANTY SMALLINT NULL,
	WARRANTYPERIOD TINYINT NULL,
 PRIMARY KEY(SLNUM ASC)
)
GO
CREATE TABLE MAS_MASTERS
    (
      MASTERID int NOT NULL,
      STATUSID int DEFAULT 0  NOT NULL,
      SUBSTATUSID int DEFAULT 0,
      LISTING VarChar(60) NOT NULL,
      PRIMARY KEY ( MASTERID, STATUSID, LISTING )
    )
GO

INSERT  INTO ACC_SECMODULES
        (
          MODID,
          MODNAME,
          MODDESC,
          PROJECTTYPE
        )
        SELECT  1002,
                N'Company Information',
                N'Company Details',
                3
        UNION ALL
        SELECT  1003,
                N'Group Details Entry',
                N'Group Details Entry',
                3
        UNION ALL
        SELECT  1004,
                N'Ledger Details Entry',
                N'Ledger Details Entry',
                3
        UNION ALL
        SELECT  1006,
                N'Tax Master',
                N'Tax Master',
                3
        UNION ALL
        SELECT  2,
                N'Accounting Option Settings',
                N'Accounting Option Settings',
                0
        UNION ALL
        SELECT  3,
                N'Voucher  Formats',
                N'Voucher  Formats',
                0
        UNION ALL
        SELECT  4,
                N'Contra',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  5,
                N'Credit Note',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  6,
                N'Debit Note',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  7,
                N'Journal',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  8,
                N'Optional',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  9,
                N'Payment',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  10,
                N'Purchase',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  11,
                N'Purchase Return',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  12,
                N'Receipt',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  13,
                N'Sales',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  14,
                N'Sales Return',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  15,
                N'Voucher Count',
                N'Voucher Entry',
                0
        UNION ALL
        SELECT  16,
                N'Cash Book',
                N'Account Books',
                0
        UNION ALL
        SELECT  17,
                N'Bank Book',
                N'Account Books',
                0
        UNION ALL
        SELECT  18,
                N'General Ledger',
                N'Account Books',
                0
        UNION ALL
        SELECT  19,
                N'Journal',
                N'Account Books',
                0
        UNION ALL
        SELECT  20,
                N'Credit Note',
                N'Account Books',
                0
        UNION ALL
        SELECT  21,
                N'Debit Note',
                N'Account Books',
                0
        UNION ALL
        SELECT  22,
                N'Sales Day Book',
                N'Account Books',
                0
        UNION ALL
        SELECT  23,
                N'Purchase Day Book',
                N'Account Books',
                0
        UNION ALL
        SELECT  24,
                N'Day Book',
                N'Account Books',
                0
        UNION ALL
        SELECT  25,
                N'Group',
                N'Account Books',
                0
        UNION ALL
        SELECT  26,
                N'Trial Balance',
                N'Final Results',
                0
        UNION ALL
        SELECT  27,
                N'Profile and Loss A/C',
                N'Final Results',
                0
        UNION ALL
        SELECT  28,
                N'Balance Sheet',
                N'Final Results',
                0
        UNION ALL
        SELECT  29,
                N'Receivable',
                N'Outstanding',
                0
        UNION ALL
        SELECT  30,
                N'Payable',
                N'Outstanding',
                0
        UNION ALL
        SELECT  31,
                N'General Ledger',
                N'Outstanding',
                0
        UNION ALL
        SELECT  32,
                N'Ageing',
                N'Outstanding',
                0
        UNION ALL
        SELECT  1014,
                N'Module Security Settings',
                N'Module Security',
                3
        UNION ALL
        SELECT  1015,
                N'Security Options',
                N'Module Security',
                3
        UNION ALL
        SELECT  1018,
                N'Software Security',
                N'Software Security',
                3
        UNION ALL
        SELECT  1019,
                N'Module Security Group',
                N'Module Security',
                3
        UNION ALL
        SELECT  1020,
                N'Module Security User',
                N'Module Security',
                3
        UNION ALL
        SELECT  38,
                N'Cost Centre',
                N'Cost Centre Settings',
                0
        UNION ALL
        SELECT  39,
                N'Cost Centre Class',
                N'Cost Centre Settings',
                0
        UNION ALL
        SELECT  40,
                N'Deductor Master',
                N'TDS Master Settings',
                0
        UNION ALL
        SELECT  41,
                N'TDS Options',
                N'TDS Master Settings',
                0
        UNION ALL
        SELECT  42,
                N'Journal Expenses',
                N'TDS Transaction',
                0
        UNION ALL
        SELECT  43,
                N'TDS Payment',
                N'TDS Transaction',
                0
        UNION ALL
        SELECT  44,
                N'Deduction Register',
                N'TDS View',
                0
        UNION ALL
        SELECT  45,
                N'Challan Register',
                N'TDS View',
                0
        UNION ALL
        SELECT  46,
                N'TDS Outstanding Register',
                N'TDS View',
                0
        UNION ALL
        SELECT  47,
                N'Epayment Extract',
                N'TDS View',
                0
        UNION ALL
        SELECT  48,
                N'Bank Reconcillation',
                N'Bank Reconcillation',
                0
        UNION ALL
        SELECT  49,
                N'Closing Stock',
                N'Closing Stock',
                0
        UNION ALL
        SELECT  50,
                N'VAT Computation',
                N'VAT Computation',
                0
        UNION ALL
        SELECT  217,
                N'Service Tax',
                N'Service Tax',
                1
        UNION ALL
        SELECT  218,
                N'Custom Reports',
                N'Reports',
                1
        UNION ALL
        SELECT  1008,
                N'Backup File',
                N'Backup File',
                3
        UNION ALL
        SELECT  1009,
                N'Restore File',
                N'Restore File',
                3
        UNION ALL
        SELECT  1010,
                N'Data Utilities',
                N'Data Utilities',
                3
        UNION ALL
        SELECT  1011,
                N'Delete Financial Year',
                N'Delete Financial Year',
                3
        UNION ALL
        SELECT  1012,
                N'New Financial Year',
                N'New Financial Year',
                3
        UNION ALL
        SELECT  216,
                N'Invoicing Option Settings',
                N'Invoicing Option Settings',
                1
        UNION ALL
        SELECT  201,
                N'Invoicing Transaction Formats',
                N'Invoicing Transaction Formats',
                1
        UNION ALL
        SELECT  202,
                N'Customer Preference',
                N'Customer Preference',
                1
        UNION ALL
        SELECT  203,
                N'Service Master',
                N'Service Master',
                1
        UNION ALL
        SELECT  204,
                N'Credit Note(Invoicing)',
                N'Invoice Entry',
                1
        UNION ALL
        SELECT  205,
                N'Debit Note(Invoicing)',
                N'Invoice Entry',
                1
        UNION ALL
        SELECT  206,
                N'Receipt(Invoicing)',
                N'Invoice Entry',
                1
        UNION ALL
        SELECT  207,
                N'Sales(Invoicing)',
                N'Invoice Entry',
                1
        UNION ALL
        SELECT  208,
                N'TDS Managemennt',
                N'TDS Management',
                1
        UNION ALL
        SELECT  209,
                N'Credit Note(Register)',
                N'Invoice Register',
                1
        UNION ALL
        SELECT  210,
                N'Debit Note(Register)',
                N'Invoice Register',
                1
        UNION ALL
        SELECT  211,
                N'Receipt(Register)',
                N'Invoice Register',
                1
        UNION ALL
        SELECT  212,
                N'Bills(Register)',
                N'Invoice Register',
                1
        UNION ALL
        SELECT  213,
                N'Advance(Register)',
                N'Invoice Register',
                1
        UNION ALL
        SELECT  214,
                N'Billing and Receipts(Register)',
                N'Invoice Register',
                1
        UNION ALL
        SELECT  215,
                N'TDS Management(Register)',
                N'Invoice Register',
                1
        UNION ALL
        SELECT  401,
                N'Item Category',
                N'Inventory General',
                2
        UNION ALL
        SELECT  402,
                N'Item Group',
                N'Inventory General',
                2
        UNION ALL
        SELECT  403,
                N'Unit Of Measure',
                N'Inventory General',
                2
        UNION ALL
        SELECT  404,
                N'Sales Price Group',
                N'Inventory General',
                2
        UNION ALL
        SELECT  405,
                N'Location Detail',
                N'Inventory General',
                2
        UNION ALL
        SELECT  406,
                N'Terms and Conditon',
                N'Inventory General',
                2
        UNION ALL
        SELECT  407,
                N'Item',
                N'Inventory General',
                2
        UNION ALL
        SELECT  408,
                N'Custom Reports',
                N'Inventory General',
                2
        UNION ALL
        SELECT  410,
                N'Options',
                N'Configuration Settings',
                2
        UNION ALL
        SELECT  411,
                N'Transaction Formats',
                N'Configuration Settings',
                2
        UNION ALL
        SELECT  412,
                N'Timber Settings',
                N'Configuration Settings',
                2
        UNION ALL
        SELECT  413,
                N'Ledger Allocation',
                N'Inventory Others',
                2
        UNION ALL
        SELECT  414,
                N'Bill Of Material',
                N'Inventory Others',
                2
        UNION ALL
        SELECT  415,
                N'Vendor Customer',
                N'Inventory Others',
                2
        UNION ALL
        SELECT  416,
                N'DC Inward',
                N'Transaction',
                2
        UNION ALL
        SELECT  417,
                N'Purchase Invoice',
                N'Transaction',
                2
        UNION ALL
        SELECT  418,
                N'Purchase Return',
                N'Transaction',
                2
        UNION ALL
        SELECT  419,
                N'DC OutWard',
                N'Transaction',
                2
        UNION ALL
        SELECT  420,
                N'Sales Invoice',
                N'Transaction',
                2
        UNION ALL
        SELECT  421,
                N'Sales Return',
                N'Transaction',
                2
        UNION ALL
        SELECT  422,
                N'Stock Journal',
                N'Transaction',
                2
        UNION ALL
        SELECT  423,
                N'URD Credit',
                N'URD',
                2
        UNION ALL
        SELECT  424,
                N'Generate VAT505',
                N'VAT505',
                2
        UNION ALL
        SELECT  425,
                N'Upload VAT 505',
                N'VAT505',
                2
        UNION ALL
        SELECT  428,
                N'Stock Ledger',
                N'Stock Information View',
                2
        UNION ALL
        SELECT  429,
                N'Stock List',
                N'Stock Information View',
                2
        UNION ALL
        SELECT  430,
                N'Stock Summary',
                N'Stock Information View',
                2
        UNION ALL
        SELECT  431,
                N'Location Summary',
                N'Stock Information View',
                2
        UNION ALL
        SELECT  432,
                N'DC IN Pending Purchase',
                N'Views --> Pending Reports',
                2
        UNION ALL
        SELECT  433,
                N'DC Out Pending Sales',
                N'Views --> Pending Reports',
                2
        UNION ALL
        SELECT  434,
                N'Transaction Register',
                N'Views',
                2
        UNION ALL
        SELECT  435,
                N'Stock Levels',
                N'Other Views',
                2
        UNION ALL
        SELECT  436,
                N'Day Book',
                N'Other Views',
                2
        UNION ALL
        SELECT  437,
                N'URD Purchase',
                N'Other Views',
                2
        UNION ALL
        SELECT  438,
                N'VAT Computation',
                N'Other Views',
                2

GO
INSERT INTO IVR_StockType
(
StockTypeName
)
SELECT N'Stock'
UNION ALL
SELECT N'Non Stock (Asset)'
UNION ALL
SELECT N'Non Stock (Expense)'
GO

/*Insert Company Status*/
INSERT INTO ACC_COMPSTATUS
(
	COMPSTATUSNAME
)
SELECT N'Company'
UNION ALL
SELECT N'Corporation'
UNION ALL
SELECT N'Individual'
UNION ALL
SELECT N'Patnership'
UNION ALL
SELECT N'Proprietor'
UNION ALL
SELECT N'Society'
UNION ALL
SELECT N'Trust'
UNION ALL
SELECT N'HUF'
UNION ALL
SELECT N'Artificial Juridical Person'

GO
/*INSERTING DEFAULT GROUP(Main Group)*/

INSERT  INTO IVR_ITEMGROUP ( IGRNAME )
VALUES  ( 'Main Group' ) ;

GO

INSERT INTO IVR_TRANSTYPE
(
TRANTYPE,
ACTIVE
)
SELECT N'Sales Invoice',	1
UNION ALL
SELECT N'DC Outward'	,0
UNION ALL
SELECT N'Sales Return',0	
UNION ALL
SELECT N'Purchase Invoice',1
UNION ALL
SELECT N'DC Inward',0
UNION ALL
SELECT N'Purchase Return',0
UNION ALL
SELECT N'Stock Journal',0
UNION ALL
SELECT N'Purchase Order',0
UNION ALL
SELECT N'Sales Order',0
GO

/*Ivr_ItemCategory*/

INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  ( 'Capital Items', 1 )
GO
INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  ( 'Components', 1 )
GO
INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  ( 'Consumables', 1 )
GO
INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  ( 'Finished Goods', 1 )
GO
INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  (
          'Intermediate Goods',
          1 
        )
GO
INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  ( 'Packing Material', 1 )
GO
INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  ( 'Raw Material', 1 )
GO
INSERT  INTO IVR_ITEMCATEGORY
        (
          [ICANAME],
          [ICAPREDEF]
        )
VALUES  ( 'Resale Items', 1 )
GO

/*End of Item Category*/


/*INSERTING DEFAULT DATA FOR WAREHOUSE*/
INSERT  INTO IVR_WAREHOUSE
        (
          WHSLOCATION,
          WHSACTIVE
        )
VALUES  ( 'Main Location', 1 )
	
GO	

/*End of Warehouse(Location) details*/

/* Default Insertion into ACC_PLGROUP*/
INSERT  INTO ACC_PLGROUP
        SELECT  GID AS GID,
                0 AS PLGROUPTYPE
        FROM    ACC_GRPMAST
        WHERE   GROUPTREEID LIKE '003%'
                OR GROUPTREEID LIKE '004%'

UPDATE  ACC_PLGROUP
SET     PLGROUPTYPE = 1
WHERE   GID IN ( 2, 24, 25, 26, 3, 57, 59, 61 )

UPDATE  ACC_PLGROUP
SET     PLGROUPTYPE = 2
WHERE   GID IN ( 27, 28, 29, 30, 31, 32, 58, 60, 62 )

UPDATE  ACC_PLGROUP
SET     PLGROUPTYPE = 3
WHERE   GID IN ( 34, 35, 36, 37 )

UPDATE  ACC_PLGROUP
SET     PLGROUPTYPE = 4
WHERE   GID IN ( 33 )
GO

INSERT  INTO ACC_SECPROJECTGROUP
        (
          PROJECTTYPE,
          PROJECTTYPENAME
        )
        SELECT  0,
                N'Accounts'
        UNION ALL
        SELECT  1,
                N'Invoice'
        UNION ALL
        SELECT  2,
                N'Inventory'
        UNION ALL
        SELECT  3,
                N'General'

GO
INSERT  INTO ACC_SECUSERRULES
        (
          [USERID],
          [MODID],
          [RIGHTS]
        )
        SELECT  1,
                2,
                62
        UNION ALL
        SELECT  1,
                3,
                62
        UNION ALL
        SELECT  1,
                4,
                62
        UNION ALL
        SELECT  1,
                5,
                62
        UNION ALL
        SELECT  1,
                6,
                62
        UNION ALL
        SELECT  1,
                7,
                62
        UNION ALL
        SELECT  1,
                8,
                62
        UNION ALL
        SELECT  1,
                9,
                62
        UNION ALL
        SELECT  1,
                10,
                62
        UNION ALL
        SELECT  1,
                11,
                62
        UNION ALL
        SELECT  1,
                12,
                62
        UNION ALL
        SELECT  1,
                13,
                62
        UNION ALL
        SELECT  1,
                14,
                62
        UNION ALL
        SELECT  1,
                15,
                62
        UNION ALL
        SELECT  1,
                16,
                62
        UNION ALL
        SELECT  1,
                17,
                62
        UNION ALL
        SELECT  1,
                18,
                62
        UNION ALL
        SELECT  1,
                19,
                62
        UNION ALL
        SELECT  1,
                20,
                62
        UNION ALL
        SELECT  1,
                21,
                62
        UNION ALL
        SELECT  1,
                22,
                62
        UNION ALL
        SELECT  1,
                23,
                62
        UNION ALL
        SELECT  1,
                24,
                62
        UNION ALL
        SELECT  1,
                25,
                62
        UNION ALL
        SELECT  1,
                26,
                62
        UNION ALL
        SELECT  1,
                27,
                62
        UNION ALL
        SELECT  1,
                28,
                62
        UNION ALL
        SELECT  1,
                29,
                62
        UNION ALL
        SELECT  1,
                30,
                62
        UNION ALL
        SELECT  1,
                31,
                62
        UNION ALL
        SELECT  1,
                32,
                62
        UNION ALL
        SELECT  1,
                38,
                62
        UNION ALL
        SELECT  1,
                39,
                62
        UNION ALL
        SELECT  1,
                40,
                62
        UNION ALL
        SELECT  1,
                41,
                62
        UNION ALL
        SELECT  1,
                42,
                62
        UNION ALL
        SELECT  1,
                43,
                62
        UNION ALL
        SELECT  1,
                44,
                62
        UNION ALL
        SELECT  1,
                45,
                62
        UNION ALL
        SELECT  1,
                46,
                62
        UNION ALL
        SELECT  1,
                47,
                62
        UNION ALL
        SELECT  1,
                48,
                62
        UNION ALL
        SELECT  1,
                49,
                62
        UNION ALL
        SELECT  1,
                50,
                62
        UNION ALL
        SELECT  1,
                201,
                62
        UNION ALL
        SELECT  1,
                202,
                62
        UNION ALL
        SELECT  1,
                203,
                62
        UNION ALL
        SELECT  1,
                204,
                62
        UNION ALL
        SELECT  1,
                205,
                62
        UNION ALL
        SELECT  1,
                206,
                62
        UNION ALL
        SELECT  1,
                207,
                62
        UNION ALL
        SELECT  1,
                208,
                62
        UNION ALL
        SELECT  1,
                209,
                62
        UNION ALL
        SELECT  1,
                210,
                62
        UNION ALL
        SELECT  1,
                211,
                62
        UNION ALL
        SELECT  1,
                212,
                62
        UNION ALL
        SELECT  1,
                213,
                62
        UNION ALL
        SELECT  1,
                214,
                62
        UNION ALL
        SELECT  1,
                215,
                62
        UNION ALL
        SELECT  1,
                216,
                62
        UNION ALL
        SELECT  1,
                217,
                62
        UNION ALL
        SELECT  1,
                218,
                62
        UNION ALL
        SELECT  1,
                1002,
                62
        UNION ALL
        SELECT  1,
                1003,
                62
        UNION ALL
        SELECT  1,
                1004,
                62
        UNION ALL
        SELECT  1,
                1006,
                62
        UNION ALL
        SELECT  1,
                1008,
                62
        UNION ALL
        SELECT  1,
                1009,
                62
        UNION ALL
        SELECT  1,
                1010,
                62
        UNION ALL
        SELECT  1,
                1011,
                62
        UNION ALL
        SELECT  1,
                1012,
                62
        UNION ALL
        SELECT  1,
                1014,
                62
        UNION ALL
        SELECT  1,
                1015,
                62
        UNION ALL
        SELECT  1,
                1018,
                62
        UNION ALL
        SELECT  1,
                1019,
                62
        UNION ALL
        SELECT  1,
                1020,
                62
        UNION ALL
        SELECT  1,
                401,
                62
        UNION ALL
        SELECT  1,
                402,
                62
        UNION ALL
        SELECT  1,
                403,
                62
        UNION ALL
        SELECT  1,
                404,
                62
        UNION ALL
        SELECT  1,
                405,
                62
        UNION ALL
        SELECT  1,
                406,
                62
        UNION ALL
        SELECT  1,
                407,
                62
        UNION ALL
        SELECT  1,
                408,
                62
        UNION ALL
        SELECT  1,
                410,
                62
        UNION ALL
        SELECT  1,
                411,
                62
        UNION ALL
        SELECT  1,
                412,
                62
        UNION ALL
        SELECT  1,
                413,
                62
        UNION ALL
        SELECT  1,
                414,
                62
        UNION ALL
        SELECT  1,
                415,
                62
        UNION ALL
        SELECT  1,
                416,
                62
        UNION ALL
        SELECT  1,
                417,
                62
        UNION ALL
        SELECT  1,
                418,
                62
        UNION ALL
        SELECT  1,
                419,
                62
        UNION ALL
        SELECT  1,
                420,
                62
        UNION ALL
        SELECT  1,
                421,
                62
        UNION ALL
        SELECT  1,
                422,
                62
        UNION ALL
        SELECT  1,
                423,
                62
        UNION ALL
        SELECT  1,
                424,
                62
        UNION ALL
        SELECT  1,
                425,
                62
        UNION ALL
        SELECT  1,
                428,
                62
        UNION ALL
        SELECT  1,
                429,
                62
        UNION ALL
        SELECT  1,
                430,
                62
        UNION ALL
        SELECT  1,
                431,
                62
        UNION ALL
        SELECT  1,
                432,
                62
        UNION ALL
        SELECT  1,
                433,
                62
        UNION ALL
        SELECT  1,
                434,
                62
        UNION ALL
        SELECT  1,
                435,
                62
        UNION ALL
        SELECT  1,
                436,
                62
        UNION ALL
        SELECT  1,
                437,
                62
        UNION ALL
        SELECT  1,
                438,
                62
GO



/*Default insertion into ACC_GRPMAST*/
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  0 AS PID,
                '001' AS GROUPTREEID,
                0 AS SECTOR,
                'Liabilities' AS GNAME,
                NULL AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                0 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  1 AS PID,
                '002' AS GROUPTREEID,
                1 AS SECTOR,
                'Assets' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                0 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003' AS GROUPTREEID,
                2 AS SECTOR,
                'Expenditure' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                0 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  3 AS PID,
                '004' AS GROUPTREEID,
                3 AS SECTOR,
                'Income' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                0 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  4 AS PID,
                '005' AS GROUPTREEID,
                4 AS SECTOR,
                'Inter Company' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                35 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBYN,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  5 AS PID,
                '006' AS GROUPTREEID,
                6 AS SECTOR,
                'Profit & Loss A/c' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                37 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  0 AS PID,
                '001001' AS GROUPTREEID,
                1 AS SECTOR,
                'Capital' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                1 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  6 AS PID,
                '001001001' AS GROUPTREEID,
                1 AS SECTOR,
                'Share Capital' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                1 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  6 AS PID,
                '001001002' AS GROUPTREEID,
                1 AS SECTOR,
                'Partner`s Capital' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                1 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  6 AS PID,
                '001001003' AS GROUPTREEID,
                1 AS SECTOR,
                'Proprietor/Proprietrix Capital' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                1 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  6 AS PID,
                '001001004' AS GROUPTREEID,
                1 AS SECTOR,
                'Reserves & Surplus' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                3 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  10 AS PID,
                '001001004001' AS GROUPTREEID,
                1 AS SECTOR,
                'General Reserve' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                3 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  10 AS PID,
                '001001004002' AS GROUPTREEID,
                1 AS SECTOR,
                'Profit & Loss Account' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                3 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  0 AS PID,
                '001002' AS GROUPTREEID,
                1 AS SECTOR,
                'Corpus Fund' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                2 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  0 AS PID,
                '001004' AS GROUPTREEID,
                1 AS SECTOR,
                'Loans' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                4 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  14 AS PID,
                '001004001' AS GROUPTREEID,
                1 AS SECTOR,
                'Secured Loans' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                5 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  14 AS PID,
                '001004002' AS GROUPTREEID,
                1 AS SECTOR,
                'Unsecured Loans' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                6 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  14 AS PID,
                '001004003' AS GROUPTREEID,
                1 AS SECTOR,
                'Bank OCC/OD A/c' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                7 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  0 AS PID,
                '001005' AS GROUPTREEID,
                1 AS SECTOR,
                'Current Liabilities & Provisions' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                8 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  18 AS PID,
                '001005001' AS GROUPTREEID,
                1 AS SECTOR,
                'Statutory Dues' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                8 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  18 AS PID,
                '001005002' AS GROUPTREEID,
                1 AS SECTOR,
                'Sundry Creditors' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                9 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  20 AS PID,
                '001005002001' AS GROUPTREEID,
                1 AS SECTOR,
                'Creditors for Goods' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                9 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  20 AS PID,
                '001005002002' AS GROUPTREEID,
                1 AS SECTOR,
                'Creditors for Services' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                9 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  18 AS PID,
                '001005003' AS GROUPTREEID,
                1 AS SECTOR,
                'Provisions' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                8 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003001' AS GROUPTREEID,
                3 AS SECTOR,
                'Opening Stock' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                13 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003002' AS GROUPTREEID,
                3 AS SECTOR,
                'Purchases' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                14 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003003' AS GROUPTREEID,
                3 AS SECTOR,
                'Direct Expenses' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                15 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003004' AS GROUPTREEID,
                3 AS SECTOR,
                'Indirect Expenses' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                16 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003005' AS GROUPTREEID,
                3 AS SECTOR,
                'Administrative Expenses' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                17 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003006' AS GROUPTREEID,
                3 AS SECTOR,
                'Selling Expenses' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                18 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003007' AS GROUPTREEID,
                3 AS SECTOR,
                'Finance Charges' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                19 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003008' AS GROUPTREEID,
                3 AS SECTOR,
                'Depreciation' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                20 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003009' AS GROUPTREEID,
                3 AS SECTOR,
                'Expenses' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                21 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003011' AS GROUPTREEID,
                3 AS SECTOR,
                'Appropriation A/c' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                22 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  2 AS PID,
                '003010' AS GROUPTREEID,
                3 AS SECTOR,
                'Inadmissible Expenses' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                22 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  34 AS PID,
                '003010001' AS GROUPTREEID,
                3 AS SECTOR,
                'Interest to Partners' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                22 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  34 AS PID,
                '003010002' AS GROUPTREEID,
                3 AS SECTOR,
                'Salaries to Partners' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                22 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  34 AS PID,
                '003010004' AS GROUPTREEID,
                3 AS SECTOR,
                'Income Tax' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                22 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  1 AS PID,
                '002001' AS GROUPTREEID,
                2 AS SECTOR,
                'Fixed Assets' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                23 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  38 AS PID,
                '002001001' AS GROUPTREEID,
                2 AS SECTOR,
                'Accumulated Depreciation' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                23 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  38 AS PID,
                '002001002' AS GROUPTREEID,
                2 AS SECTOR,
                'Capital Work in Progress' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                23 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  1 AS PID,
                '002002' AS GROUPTREEID,
                2 AS SECTOR,
                'Investments' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                24 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  1 AS PID,
                '002003' AS GROUPTREEID,
                2 AS SECTOR,
                'Current Assets, Loans & Advances' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                25 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  42 AS PID,
                '002003001' AS GROUPTREEID,
                2 AS SECTOR,
                'Current Assets' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  43 AS PID,
                '002003001001' AS GROUPTREEID,
                2 AS SECTOR,
                'Cash in Hand' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  43 AS PID,
                '002003001002' AS GROUPTREEID,
                2 AS SECTOR,
                'Bank Accounts' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  43 AS PID,
                '002003001003' AS GROUPTREEID,
                2 AS SECTOR,
                'Stock in Hand' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  43 AS PID,
                '002003001004' AS GROUPTREEID,
                2 AS SECTOR,
                'Deposits' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  47 AS PID,
                '002003001004001' AS GROUPTREEID,
                2 AS SECTOR,
                'Statutory Deposits' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  47 AS PID,
                '002003001004002' AS GROUPTREEID,
                2 AS SECTOR,
                'Other Deposits' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  42 AS PID,
                '002003002' AS GROUPTREEID,
                2 AS SECTOR,
                'Loans & Advances' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  50 AS PID,
                '002003002001' AS GROUPTREEID,
                2 AS SECTOR,
                'Advance to Suppliers' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  50 AS PID,
                '002003002002' AS GROUPTREEID,
                2 AS SECTOR,
                'Staff Advances' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  50 AS PID,
                '002003002003' AS GROUPTREEID,
                2 AS SECTOR,
                'Other Advances' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                26 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  43 AS PID,
                '002003001006' AS GROUPTREEID,
                2 AS SECTOR,
                'Sundry Debtors' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                27 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  1 AS PID,
                '002005' AS GROUPTREEID,
                2 AS SECTOR,
                'Miscellaneous Expenditure' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                29 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  1 AS PID,
                '002006' AS GROUPTREEID,
                2 AS SECTOR,
                'Profit & Loss ( Debit Balance)' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                30 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  3 AS PID,
                '004001' AS GROUPTREEID,
                4 AS SECTOR,
                'Sales' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                31 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  3 AS PID,
                '004002' AS GROUPTREEID,
                4 AS SECTOR,
                'Other Income' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                32 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  3 AS PID,
                '004003' AS GROUPTREEID,
                4 AS SECTOR,
                'Closing Stock' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                33 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  3 AS PID,
                '004004' AS GROUPTREEID,
                4 AS SECTOR,
                'Income Tax Refund' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                1 AS BEHAVIOURHEAD,
                34 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  3 AS PID,
                '004005' AS GROUPTREEID,
                4 AS SECTOR,
                'Direct Incomes' AS GNAME,
                '' AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                3 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO 
INSERT  INTO ACC_GRPMAST
        (
          PID,
          GROUPTREEID,
          SECTOR,
          GNAME,
          GANAME,
          PREDEFINED,
          BEHAVIOURHEAD,
          BEHAVIOURID,
          CREATED,
          MODIFIED,
          CREATEDBY,
          MODIFIEDBY,
          SCHNAME
        )
        SELECT  3 AS PID,
                '004006' AS GROUPTREEID,
                4 AS SECTOR,
                'Indirect Incomes' AS GNAME,
                NULL AS GANAME,
                1 AS PREDEFINED,
                0 AS BEHAVIOURHEAD,
                3 AS BEHAVIOURID,
                NULL AS CREATED,
                NULL AS MODIFIED,
                NULL AS CREATEDBY,
                NULL AS MODIFIEDBY,
                NULL AS SCHNAME
GO
/*Default insertion in MAS_Country*/
INSERT INTO MAS_COUNTRY(COUNTRYNAME)
		VALUES('India')

/*Default insertion into MAS_STATE*/
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('1','1','Andaman And Nicobar Islands')        
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('2','1','Andhra Pradesh' )
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('3','1', 'Arunachal Pradesh')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('4','1','Assam')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('5','1','Bihar')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('6','1','Chandigarh')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('7','1','Dadra & Nagar Haveli')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('8','1','Daman & Diu')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('9','1','Delhi')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('10','1','Goa')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('11','1','Gujarat')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('12','1', 'Haryana') 
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('13','1','Himachal Pradesh')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('14','1','Jammu & Kashmir')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('15','1','Karnataka')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('16','1','Kerale')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('17','1','Lakhswadeep')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('18','1','Madhya Pradesh')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('19','1','Maharashtra')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('20','1','Manipur')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('21','1','Meghalaya')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('22','1','Mizoram')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('23','1','Nagaland')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('24','1','Orissa')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('25','1','Pondicherry')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('26','1','Punjab')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('27','1','Rajasthan')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('28','1','Sikkim')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('29','1','Tamilnadu')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('30','1','Tripura')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('31','1','Uttar Pradesh')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('32','1','West Bengal')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('33','1','Chhatishgarh')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('34','1','Uttaranchal')
GO 
INSERT  INTO MAS_STATE(STATECODE,COUNTRYID,STATENAME)
		VALUES('35','1','Jharkhand')
GO 



/*Default insertion into ACC_SETTINGS*/
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  1 AS SETTINGID,
                'Display of Large Amount' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                '' AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  2 AS SETTINGID,
                'Display of Negative Amount' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                '' AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  3 AS SETTINGID,
                'Date Format' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                '0' AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  4 AS SETTINGID,
                'Number of Decimal places' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                '2' AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  5 AS SETTINGID,
                'Formal Name' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                '0' AS SETTINGVALUE
GO 
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  6 AS SETTINGID,
                'Decimal Name' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                '0' AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  7 AS SETTINGID,
                'Symbol' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                '0' AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  8 AS SETTINGID,
                'Previous years figures in balance sheet and P&L A/c' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO 
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  9 AS SETTINGID,
                'Negative Cash Balance' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO 
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  10 AS SETTINGID,
                'USL Repayment' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  11 AS SETTINGID,
                'Rule 6DD of IT' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  12 AS SETTINGID,
                'Debits and Credits interchange' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  13 AS SETTINGID,
                'Inverse and Obverse Accounts' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  14 AS SETTINGID,
                'Stastical View' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  15 AS SETTINGID,
                'Allow sub accounts under Ledger' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  16 AS SETTINGID,
                'Show Net Purchase Consumption' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  17 AS SETTINGID,
                'Fixed Assets Details' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  18 AS SETTINGID,
                'Split Profit & Loss A/c' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  19 AS SETTINGID,
                'Show Manufacturing A/c' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  20 AS SETTINGID,
                'Show Trading A/c' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  21 AS SETTINGID,
                'Show P&L A/c' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  22 AS SETTINGID,
                'Show Inadmissible Expenses A/c' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  23 AS SETTINGID,
                'Show Appropriation A/c' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  24 AS SETTINGID,
                'Header Label: P&L A/c or Income/Expenditure A/c' AS SETTINGNAME,
                1 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  25 AS SETTINGID,
                'Header Label: Year Ended/Period Ended' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  26 AS SETTINGID,
                'Schedule Numbering Type' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  27 AS SETTINGID,
                'Ledger View Type' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                3 AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  28 AS SETTINGID,
                'Enable TDS' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  29 AS SETTINGID,
                'TDS Rounding' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                0 AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  30 AS SETTINGID,
                'Avail ST Credit' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO
INSERT  INTO ACC_SETTINGS
        (
          SETTINGID,
          SETTINGNAME,
          CHECKSTATUS,
          SETTINGVALUE
        )
        SELECT  31 AS SETTINGID,
                'Enable Cost Centre' AS SETTINGNAME,
                0 AS CHECKSTATUS,
                NULL AS SETTINGVALUE
GO

/* Insert Into MAS_MASTER*/
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                1 AS STATUSID,
                0 AS SUBSTATUSID,
                'Artificial juridical person' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                2 AS STATUSID,
                0 AS SUBSTATUSID,
                'Association of Persons' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                3 AS STATUSID,
                0 AS SUBSTATUSID,
                'Body of Individual' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                4 AS STATUSID,
                0 AS SUBSTATUSID,
                'Company' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                5 AS STATUSID,
                0 AS SUBSTATUSID,
                'Partnership Firm' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                6 AS STATUSID,
                0 AS SUBSTATUSID,
                'Co-operative Society' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                7 AS STATUSID,
                0 AS SUBSTATUSID,
                'HUF' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                8 AS STATUSID,
                0 AS SUBSTATUSID,
                'Individual' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                9 AS STATUSID,
                0 AS SUBSTATUSID,
                'Local Authority' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  2 AS MASTERID,
                10 AS STATUSID,
                0 AS SUBSTATUSID,
                'Trusts' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                2 AS STATUSID,
                10 AS SUBSTATUSID,
                'Maximum marginal rate' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                2 AS STATUSID,
                11 AS SUBSTATUSID,
                'Others' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                3 AS STATUSID,
                8 AS SUBSTATUSID,
                'Maximum marginal rate' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                3 AS STATUSID,
                9 AS SUBSTATUSID,
                'Others' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                4 AS STATUSID,
                1 AS SUBSTATUSID,
                'Domestic company with public interest' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                4 AS STATUSID,
                2 AS SUBSTATUSID,
                'Domestic company without  public interest' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                4 AS STATUSID,
                3 AS SUBSTATUSID,
                'Other than domestic company' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                6 AS STATUSID,
                6 AS SUBSTATUSID,
                'Banks' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                6 AS STATUSID,
                7 AS SUBSTATUSID,
                'Others' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                8 AS STATUSID,
                4 AS SUBSTATUSID,
                'Female' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                8 AS STATUSID,
                5 AS SUBSTATUSID,
                'Male' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                10 AS STATUSID,
                12 AS SUBSTATUSID,
                'Maximum marginal rate' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  3 AS MASTERID,
                10 AS STATUSID,
                13 AS SUBSTATUSID,
                'Others' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  5 AS MASTERID,
                0 AS STATUSID,
                0 AS SUBSTATUSID,
                'Direct' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  5 AS MASTERID,
                0 AS STATUSID,
                0 AS SUBSTATUSID,
                'Email' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  5 AS MASTERID,
                0 AS STATUSID,
                0 AS SUBSTATUSID,
                'Phone' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  6 AS MASTERID,
                0 AS STATUSID,
                0 AS SUBSTATUSID,
                'Not Yet Started' AS LISTING
GO 
INSERT  INTO MAS_MASTERS
        SELECT  7 AS MASTERID,
                0 AS STATUSID,
                0 AS SUBSTATUSID,
                'Not Yet Raised' AS LISTING
GO 
/****** Object:  Table [dbo].[ACC_Btype]    Script Date: 11/20/2010 15:10:58 ******/
SET IDENTITY_INSERT ACC_Btype ON
INSERT ACC_Btype (BTypeId, BTypeName) VALUES (1, N'Manufacturing')
INSERT ACC_Btype (BTypeId, BTypeName) VALUES (2, N'Professional')
INSERT ACC_Btype (BTypeId, BTypeName) VALUES (3, N'Service')
INSERT ACC_Btype (BTypeId, BTypeName) VALUES (4, N'Trading')
SET IDENTITY_INSERT ACC_Btype OFF
GO
INSERT INTO UserGroup ([GroupName], [GroupDescription]) VALUES ('Admin', N'Administrator')
GO